diff --git a/nixos/doc/manual/release-notes/rl-2411.section.md b/nixos/doc/manual/release-notes/rl-2411.section.md index b2930f3b6f291..f49a0b4472b31 100644 --- a/nixos/doc/manual/release-notes/rl-2411.section.md +++ b/nixos/doc/manual/release-notes/rl-2411.section.md @@ -102,6 +102,8 @@ - [Flood](https://flood.js.org/), a beautiful WebUI for various torrent clients. Available as [services.flood](options.html#opt-services.flood). +- [Niri](https://github.com/YaLTeR/niri), a scrollable-tiling Wayland compositor. Available as [programs.niri](options.html#opt-programs.niri.enable). + - [Firefly-iii Data Importer](https://github.com/firefly-iii/data-importer), a data importer for Firefly-III. Available as [services.firefly-iii-data-importer](options.html#opt-services.firefly-iii-data-importer) - [QGroundControl], a ground station support and configuration manager for the PX4 and APM Flight Stacks. Available as [programs.qgroundcontrol](options.html#opt-programs.qgroundcontrol.enable). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 6f5357382dc56..0d12789ebc79f 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -311,6 +311,7 @@ ./programs/wayland/hyprland.nix ./programs/wayland/labwc.nix ./programs/wayland/miracle-wm.nix + ./programs/wayland/niri.nix ./programs/wayland/river.nix ./programs/wayland/sway.nix ./programs/wayland/uwsm.nix diff --git a/nixos/modules/programs/wayland/niri.nix b/nixos/modules/programs/wayland/niri.nix new file mode 100644 index 0000000000000..9f0499444bd33 --- /dev/null +++ b/nixos/modules/programs/wayland/niri.nix @@ -0,0 +1,76 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.programs.niri; +in +{ + options.programs.niri = { + enable = lib.mkEnableOption "Niri, a scrollable-tiling Wayland compositor"; + + package = lib.mkPackageOption pkgs "niri" { }; + + # Recommended by upstream + # https://github.com/YaLTeR/niri/wiki/Important-Software#authentication-agent + polkitAgent.enable = lib.mkEnableOption "a PolicyKit agent service" // { + default = config.security.polkit.enable; + defaultText = "config.security.polkit.enable"; + }; + + # Recommended by upstream + # https://github.com/YaLTeR/niri/wiki/Important-Software#portals + portalPackage = lib.mkPackageOption pkgs "xdg-desktop-portal-gnome" { + # https://github.com/NixOS/nixpkgs/pull/348193#discussion_r1798515394 + extraDescription = "Note: `xdg-desktop-portal-gnome` is required for screencast support"; + }; + }; + + config = lib.mkIf cfg.enable ( + lib.mkMerge [ + { + environment.systemPackages = [ cfg.package ]; + + services = { + displayManager.sessionPackages = [ cfg.package ]; + + # Recommended by upstream + # https://github.com/YaLTeR/niri/wiki/Important-Software#portals + gnome.gnome-keyring.enable = lib.mkDefault true; + }; + + systemd.packages = [ cfg.package ]; + + xdg.portal = { + enable = lib.mkDefault true; + + configPackages = [ cfg.package ]; + extraPortals = [ cfg.portalPackage ]; + }; + } + + (lib.mkIf cfg.polkitAgent.enable { + systemd = { + packages = [ pkgs.libsForQt5.polkit-kde-agent ]; + user.services.plasma-polkit-agent = { + wantedBy = [ "niri.service" ]; + }; + }; + }) + + (import ./wayland-session.nix { + inherit lib pkgs; + enableWlrPortal = false; + enableXWayland = false; + }) + ] + ); + + meta.maintainers = with lib.maintainers; [ + getchoo + sodiboo + ]; +}