Adding sway

This commit is contained in:
Lyes Saadi 2025-02-01 14:42:49 +01:00
parent 35dc350142
commit 2169525730
No known key found for this signature in database
GPG key ID: 17418538BAA17767
4 changed files with 71 additions and 19 deletions

View file

@ -67,7 +67,7 @@ in {
heroic
# cemu
prismlauncher
vvvvvv
# vvvvvv
ryujinx
dolphin-emu
parsec-bin
@ -127,6 +127,7 @@ in {
gnome-firmware
# Utilities
ghostty
impression
resources
file-roller

50
modules/sway/default.nix Normal file
View file

@ -0,0 +1,50 @@
{ pkgs, ... }:
let xwayland-sway =
(pkgs.writeScriptBin "Xwayland-sway" ''
#! ${pkgs.bash}/bin/bash
exec ${pkgs.xwayland}/bin/Xwayland "$@" -hidpi
'');
in
{
programs.sway = {
enable = true;
wrapperFeatures = {
base = true;
gtk = true;
};
extraOptions = [
"--unsupported-gpu"
];
extraSessionCommands = ''
# SDL:
export SDL_VIDEODRIVER=wayland
# QT (needs qt5.qtwayland in systemPackages):
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
# Fix for some Java AWT applications (e.g. Android Studio),
# use this if they aren't displayed properly:
export _JAVA_AWT_WM_NONREPARENTING=1
export WLR_XWAYLAND=${xwayland-sway}
'';
extraPackages = with pkgs; [
brightnessctl
grim
swayidle
swaylock
wmenu
mako
waybar
poweralertd
lxde.lxsession
networkmanagerapplet
wofi
wlogout
slurp
];
};
environment.systemPackages = [
xwayland-sway
];
}