nichts/modules/wms/wayland/niri/module.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

2025-05-30 18:19:51 +02:00
{
config,
inputs,
2025-05-30 18:19:51 +02:00
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-05-30 18:19:51 +02:00
cfg = config.modules.desktops.niri;
latestNightly = (inputs.rust-overlay.lib.mkRustBin {} pkgs).nightly.latest.default;
rustPlatform = pkgs.makeRustPlatform {
rustc = latestNightly;
cargo = latestNightly;
stdenv = pkgs.clangStdenv;
};
new-swww = (pkgs.swww.override {inherit rustPlatform;}).overrideAttrs (prev: {
src = pkgs.fetchFromGitHub {
inherit (prev.src) owner repo;
rev = "398a4048e389341dfd55285c53518a8ea3930ec4";
hash = "sha256-ZAC5TbkshztW2IeDorhaxUmVCHf2tJCSGIGHSNl91Ns";
};
doInstallCheck = false;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (new-swww) src;
hash = "sha256-YH2gcy/8EtUmTHzwt38bBOFX3saN1wHIGQ5/eWqvSeM=";
};
});
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;
package = pkgs.niri;
};
# 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 {
inherit (pkgs) xwayland-satellite avizo;
inherit new-swww;
2025-06-12 20:12:47 +02:00
};
2025-06-04 08:29:36 +02:00
};
2025-05-30 18:19:51 +02:00
}