-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
]; | ||
} |