nixos/programs: factor out wayland-session common options

This commit is contained in:
Gaetan Lepage 2023-05-15 13:45:09 +02:00
parent 94dca479f4
commit c7bd5289d6
4 changed files with 57 additions and 36 deletions

View File

@ -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

View File

@ -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 ];
}

View 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
];
};
}