2025-05-30 18:19:51 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib.modules) mkForce mkIf;
|
|
|
|
inherit (lib.options) mkEnableOption;
|
2025-06-12 20:12:47 +02:00
|
|
|
inherit (config.modules.system) isGraphical;
|
2025-06-26 20:48:39 +02:00
|
|
|
|
2025-07-13 21:13:23 +02:00
|
|
|
cfg = config.modules.desktops.niri;
|
2025-07-08 22:58:26 +02:00
|
|
|
|
|
|
|
patched-niri = pkgs.niri.overrideAttrs (prev: {
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
inherit (prev.src) owner repo;
|
|
|
|
rev = "37458d94b288945f6cfbd3c5c233f634d59f246c";
|
|
|
|
hash = "sha256-F5iVU/hjoSHSSe0gllxm0PcAaseEtGNanYK5Ha3k2Tg=";
|
|
|
|
};
|
|
|
|
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
|
|
|
|
inherit (patched-niri) src;
|
|
|
|
hash = "sha256-fT0L/OTlQ9BnKHnckKsLi+tN+oevEU+eJWrh1INqQhA=";
|
|
|
|
};
|
|
|
|
patches = [
|
|
|
|
(pkgs.fetchpatch {
|
|
|
|
url = "https://github.com/YaLTeR/niri/commit/ab71a6c553f9c53ea484ec6dedc5dcede708929f.diff";
|
|
|
|
hash = "sha256-C3TJIK5/YTAcmdSP6NyOwX+1oA36u6nrMuJuVYIvAHQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
});
|
2025-05-30 18:19:51 +02:00
|
|
|
in {
|
|
|
|
options.modules.desktops.niri.enable = mkEnableOption "Niri, a scolling tiling wayland compositor";
|
|
|
|
|
2025-06-12 20:12:47 +02:00
|
|
|
config =
|
|
|
|
mkIf (cfg.enable
|
|
|
|
|| isGraphical)
|
|
|
|
{
|
|
|
|
programs.niri = {
|
|
|
|
enable = true;
|
2025-07-08 22:58:26 +02:00
|
|
|
package = patched-niri;
|
2025-06-12 20:12:47 +02:00
|
|
|
};
|
|
|
|
# The niri module auto enables the gnome keyring,
|
|
|
|
# which is something I direly want to avoid.
|
|
|
|
services.gnome.gnome-keyring.enable = mkForce false;
|
2025-05-26 12:23:30 +02:00
|
|
|
|
2025-06-12 20:12:47 +02:00
|
|
|
environment.etc."niri/config.kdl".source = ./config.kdl;
|
|
|
|
|
|
|
|
environment.systemPackages = builtins.attrValues {
|
2025-07-13 22:51:22 +02:00
|
|
|
inherit
|
|
|
|
(pkgs)
|
|
|
|
xwayland-satellite
|
|
|
|
avizo
|
|
|
|
playerctl
|
|
|
|
wl-clipboard
|
|
|
|
;
|
2025-06-12 20:12:47 +02:00
|
|
|
};
|
2025-06-04 08:29:36 +02:00
|
|
|
};
|
2025-05-30 18:19:51 +02:00
|
|
|
}
|