Files
nixos-blueprint/modules/nixos/desktop/niri/default.nix
2025-07-02 19:06:12 +03:00

46 lines
1.1 KiB
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";
gnome-keyring.enable = true;
};
sound.pipewire.enable = true;
programs.niri.enable = true; # wayland compositor in rust
security = {
pam.services.gtklock = {};
soteria.enable = true; # polkit agent in rust
};
services = {
blueman.enable = config.hardware.bluetooth.enable;
gvfs.enable = true;
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gnome xdg-desktop-portal-gtk];
config.niri.default = ["gnome" "gtk"];
};
})
(mkIf (cfg.enable
&& config.services.displayManager.autoLogin.enable) {
services.greetd.settings.initial_session = {
command = "niri-session";
user = config.services.displayManager.autoLogin.user;
};
})
];
}