Remove uwsm and use niri's sessions

This commit is contained in:
2025-08-29 17:34:35 +02:00
parent f265cb5630
commit 7bd6111065
5 changed files with 66 additions and 58 deletions
+2 -22
View File
@@ -1,7 +1,6 @@
{
pkgs,
user,
lib,
...
}: {
imports = [
@@ -9,17 +8,7 @@
../../modules/gui
];
programs.uwsm = {
enable = true;
waylandCompositors = {
niri = {
prettyName = "niri";
comment = "niri compositor managed by UWSM";
binPath = "${pkgs.niri}/bin/niri";
};
};
};
programs.niri.enable = true;
services.greetd = {
enable = true;
settings = {
@@ -28,18 +17,9 @@
user = "greeter";
};
initial_session = {
command = "${lib.getExe pkgs.uwsm} start -S niri-uwsm.desktop";
command = ./niri-session.sh; # "${pkgs.niri}/bin/niri-session";
user = user;
};
};
};
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gnome
];
config.common.default = "*";
configPackages = with pkgs; [niri];
};
}
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
# Snippet from the official niri-session
# We remove the `import-environment` (and login shell sourcing that became useless), this is needed otherwise SHLVL gets in the systemd env and it breaks stuff
if systemctl --user -q is-active niri.service; then
echo 'A niri session is already running.'
exit 1
fi
systemctl --user reset-failed
# still need path to have things like systemctl
systemctl --user import-environment PATH
systemctl --user --wait start niri.service
systemctl --user start --job-mode=replace-irreversibly niri-shutdown.target
systemctl --user unset-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP NIRI_SOCKET
+15 -6
View File
@@ -70,9 +70,9 @@ binds {
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "s" "+5%"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "s" "5%-"; }
Mod+R { spawn "uwsm" "app" "--" "zen"; }
Mod+E { spawn "uwsm" "app" "--" "kitty"; }
Mod+P { spawn "rofi" "-show" "drun" "-show-icons" "-run-command" "uwsm app -- {cmd}"; }
Mod+R { spawn "zen"; }
Mod+E { spawn "kitty"; }
Mod+P { spawn "rofi" "-show" "drun" "-show-icons" "-run-command" "{cmd}"; }
Mod+S { spawn "screenshot"; }
Mod+Control+S { spawn "screenshot-freeze"; }
Mod+Shift+S { spawn "record"; }
@@ -81,7 +81,7 @@ binds {
Mod+X repeat=false { spawn "wtype" "-k" "XF86Cut"; }
Mod+C repeat=false { spawn "wtype" "-k" "XF86Copy" "-s" "200ms"; }
Mod+V repeat=false { spawn "wtype" "-k" "XF86Paste"; }
Mod+Shift+V repeat=false { spawn-sh "cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy"; }
Mod+Shift+V repeat=false { spawn "sh" "-c" "cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy"; }
Mod+Space repeat=false { toggle-overview; }
Mod+Q repeat=false { close-window; }
@@ -189,13 +189,21 @@ binds {
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
}
workspace "emtpy" {
open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}
workspace "chat" {
open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}
workspace "work" {
open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
}
window-rule {
match at-startup=true
open-on-output "Dell Inc. DELL S2722QC 2HHZH24"
open-on-workspace "work"
open-maximized true
open-focused false
}
@@ -203,11 +211,12 @@ window-rule {
window-rule {
match app-id="discord"
match app-id="vesktop"
match app-id="YouTube Music"
match app-id="com.github.th_ch.youtube_music"
open-on-workspace "chat"
}
spawn-at-startup "wallpaper"
spawn-at-startup "ags"
spawn-at-startup "uwsm" "finalize" "DISPLAY" "WAYLAND_DISPLAY" "XDG_CURRENT_DESKTOP" "NIXOS_OZONE_WL" "XCURSOR_THEME" "XCURSOR_SIZE" "NIRI_SOCKET"
spawn-at-startup "kitty"
spawn-at-startup "zen"
spawn-at-startup "hyprlock" "--immediate"
Generated
+30 -30
View File
@@ -100,11 +100,11 @@
]
},
"locked": {
"lastModified": 1755446520,
"narHash": "sha256-I0Ok1OGDwc1jPd8cs2VvAYZsHriUVFGIUqW+7uSsOUM=",
"lastModified": 1755960406,
"narHash": "sha256-RF7j6C1TmSTK9tYWO6CdEMtg6XZaUKcvZwOCD2SICZs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "4b04db83821b819bbbe32ed0a025b31e7971f22e",
"rev": "e891a93b193fcaf2fc8012d890dc7f0befe86ec2",
"type": "github"
},
"original": {
@@ -164,11 +164,11 @@
]
},
"locked": {
"lastModified": 1755914636,
"narHash": "sha256-VJ+Gm6YsHlPfUCpmRQxvdiZW7H3YPSrdVOewQHAhZN8=",
"lastModified": 1756261190,
"narHash": "sha256-eiy0klFK5EVJLNilutR7grsZN/7Itj9DyD75eyOf83k=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "8b55a6ac58b678199e5bba701aaff69e2b3281c0",
"rev": "77f348da3176dc68b20a73dab94852a417daf361",
"type": "github"
},
"original": {
@@ -205,11 +205,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1755851532,
"narHash": "sha256-unks5nXZZtI6hfbXPBL0ll0OjqqyEk2OG1lWugRc/dA=",
"lastModified": 1756453197,
"narHash": "sha256-h5vsWwLzU6+TIY5yqR6ps8JQh9S8WRU9xxsnckM/HSE=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "301e087de6502904806215c9e3f6e89e50f18fd3",
"rev": "3edf4118b2bb7182ceabbd9ce0a374c415e5a793",
"type": "github"
},
"original": {
@@ -221,11 +221,11 @@
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1755815325,
"narHash": "sha256-7pkRFiHxKQ/1HW+v7cYho93eukrVOm2W83HDXUwR17E=",
"lastModified": 1756423423,
"narHash": "sha256-2ybzbB4lADwLkAST+FVFIXw1v+VjmQarsNWCKTFW/qE=",
"owner": "neovim",
"repo": "neovim",
"rev": "865a28155e7b66a16c4e7bd0b8d1220a3f25375a",
"rev": "19f2e5c3eb4194a4b4255abb01991af63c1979b3",
"type": "github"
},
"original": {
@@ -261,11 +261,11 @@
]
},
"locked": {
"lastModified": 1755404379,
"narHash": "sha256-Q6ZxZDBmD/B988Jjbx7/NchxOKIpOKBBrx9Yb0zMzpQ=",
"lastModified": 1756008611,
"narHash": "sha256-rfTBWuTXi9/X7GhtF562FKNXKh2kvKb6dwI5lV1SjPE=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "ebbc1c05f786ae39bb5e04e57bf2c10c44a649e3",
"rev": "52dec1cb33a614accb9e01307e17816be974d24d",
"type": "github"
},
"original": {
@@ -291,11 +291,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1755330281,
"narHash": "sha256-aJHFJWP9AuI8jUGzI77LYcSlkA9wJnOIg4ZqftwNGXA=",
"lastModified": 1756245047,
"narHash": "sha256-9bHzrVbjAudbO8q4vYFBWlEkDam31fsz0J7GB8k4AsI=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "3dac8a872557e0ca8c083cdcfc2f218d18e113b0",
"rev": "a65b650d6981e23edd1afa1f01eb942f19cdcbb7",
"type": "github"
},
"original": {
@@ -328,11 +328,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1755615617,
"narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
"lastModified": 1756386758,
"narHash": "sha256-1wxxznpW2CKvI9VdniaUnTT2Os6rdRJcRUf65ZK9OtE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "20075955deac2583bb12f07151c2df830ef346b4",
"rev": "dfb2f12e899db4876308eba6d93455ab7da304cd",
"type": "github"
},
"original": {
@@ -359,11 +359,11 @@
"tmux": {
"flake": false,
"locked": {
"lastModified": 1755863899,
"narHash": "sha256-cY8asJFrTA9i2I6DFx111gFNWvRNl3XPzldH7pjiO2M=",
"lastModified": 1756198867,
"narHash": "sha256-vcBMdGgHEKlh6UuzoStPTmZt9KIM9AQZLH7fCpVii6s=",
"owner": "tmux",
"repo": "tmux",
"rev": "bb4866047a192388a991566ebf6d9cd3d8b8fee5",
"rev": "fa63088dceab9b9397d5cfde83b19839a6a881d7",
"type": "github"
},
"original": {
@@ -380,11 +380,11 @@
]
},
"locked": {
"lastModified": 1754847726,
"narHash": "sha256-2vX8QjO5lRsDbNYvN9hVHXLU6oMl+V/PsmIiJREG4rE=",
"lastModified": 1755934250,
"narHash": "sha256-CsDojnMgYsfshQw3t4zjRUkmMmUdZGthl16bXVWgRYU=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "7d81f6fb2e19bf84f1c65135d1060d829fae2408",
"rev": "74e1a52d5bd9430312f8d1b8b0354c92c17453e5",
"type": "github"
},
"original": {
@@ -400,11 +400,11 @@
]
},
"locked": {
"lastModified": 1754886070,
"narHash": "sha256-MZDmxOkVKL1HY72bliN8Gxh0SYkHUa3W/1fTU2ke36I=",
"lastModified": 1756440354,
"narHash": "sha256-sYbFYDOkBOoUr+L4vzwoDuPVTducUNbkSSvvI/i/Lv4=",
"owner": "youwen5",
"repo": "zen-browser-flake",
"rev": "e37d2b326311320c8571111b3ef89b29d26d4b64",
"rev": "e0c59efe742821feb04049acf9ef7f472e0d325c",
"type": "github"
},
"original": {
+2
View File
@@ -23,6 +23,8 @@ in {
zen-browser.packages.${pkgs.system}.default
vesktop
mpv
freecad
kicad
xdg-utils
zathura
libreoffice