nixos/programs: factor out wayland-session common options
This commit is contained in:
parent
94dca479f4
commit
c7bd5289d6
|
@ -241,7 +241,6 @@
|
|||
./programs/starship.nix
|
||||
./programs/steam.nix
|
||||
./programs/streamdeck-ui.nix
|
||||
./programs/sway.nix
|
||||
./programs/sysdig.nix
|
||||
./programs/system-config-printer.nix
|
||||
./programs/systemtap.nix
|
||||
|
@ -256,7 +255,8 @@
|
|||
./programs/usbtop.nix
|
||||
./programs/vim.nix
|
||||
./programs/wavemon.nix
|
||||
./programs/waybar.nix
|
||||
./programs/wayland/sway.nix
|
||||
./programs/wayland/waybar.nix
|
||||
./programs/weylus.nix
|
||||
./programs/wireshark.nix
|
||||
./programs/xastir.nix
|
||||
|
@ -1308,7 +1308,6 @@
|
|||
./services/x11/window-managers/default.nix
|
||||
./services/x11/window-managers/fluxbox.nix
|
||||
./services/x11/window-managers/icewm.nix
|
||||
./services/x11/window-managers/bspwm.nix
|
||||
./services/x11/window-managers/katriawm.nix
|
||||
./services/x11/window-managers/metacity.nix
|
||||
./services/x11/window-managers/nimdow.nix
|
||||
|
|
|
@ -123,7 +123,9 @@ in {
|
|||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = mkIf cfg.enable
|
||||
(mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.extraSessionCommands != "" -> cfg.wrapperFeatures.base;
|
||||
|
@ -147,17 +149,11 @@ in {
|
|||
"sway/config".source = mkOptionDefault "${cfg.package}/etc/sway/config";
|
||||
};
|
||||
};
|
||||
security.polkit.enable = true;
|
||||
security.pam.services.swaylock = {};
|
||||
hardware.opengl.enable = mkDefault true;
|
||||
fonts.enableDefaultFonts = mkDefault true;
|
||||
programs.dconf.enable = mkDefault true;
|
||||
# To make a Sway session available if a display manager like SDDM is enabled:
|
||||
services.xserver.displayManager.sessionPackages = optionals (cfg.package != null) [ cfg.package ];
|
||||
programs.xwayland.enable = mkDefault true;
|
||||
# For screen sharing (this option only has an effect with xdg.portal.enable):
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
|
||||
};
|
||||
}
|
||||
(import ./wayland-session.nix { inherit lib; })
|
||||
]);
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ primeos colemickens ];
|
||||
}
|
26
nixos/modules/programs/wayland/wayland-session.nix
Normal file
26
nixos/modules/programs/wayland/wayland-session.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ lib, ... }: with lib; {
|
||||
|
||||
security = {
|
||||
polkit.enable = true;
|
||||
pam.services.swaylock = {};
|
||||
};
|
||||
|
||||
hardware.opengl.enable = mkDefault true;
|
||||
|
||||
fonts.enableDefaultFonts = mkDefault true;
|
||||
|
||||
programs = {
|
||||
dconf.enable = mkDefault true;
|
||||
xwayland.enable = mkDefault true;
|
||||
};
|
||||
|
||||
|
||||
xdg.portal = {
|
||||
enable = mkDefault true;
|
||||
|
||||
extraPortals = [
|
||||
# For screen sharing
|
||||
pkgs.xdg-desktop-portal-wlr
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue