Files
nixos-blueprint/modules/nixos/desktop/niri.nix
2025-06-14 17:26:23 +03:00

39 lines
986 B
Nix

{
config,
pkgs,
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.desktop.niri;
in {
options = {
desktop.niri.enable =
mkEnableOption "enable niri desktop";
};
config = lib.mkMerge [
(mkIf cfg.enable {
module.desktop.displayManager = "greetd";
module.desktop.gnome-keyring.enable = true;
sound.pipewire.enable = true;
security = {
soteria.enable = true; # polkit agent in rust
pam.services.gtklock = {};
};
programs.niri.enable = true; # wayland compositor in rust
xdg.portal = {
enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gnome xdg-desktop-portal-gtk];
config.niri.default = ["gnome" "gtk"];
};
})
(mkIf config.services.displayManager.autoLogin.enable {
services.greetd.settings.initial_session = {
command = "niri-session";
user = config.services.displayManager.autoLogin.user;
};
})
];
}