Merge pull request #245105 from thoughtfull-systems/xfce-exclude-packages

nixos/xfce: add environment.xfce.excludePackages option
This commit is contained in:
Bobby Rong 2023-07-25 11:39:30 +08:00 committed by GitHub
commit 34d40c6f20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,10 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, utils, ... }:
with lib;
let
cfg = config.services.xserver.desktopManager.xfce;
excludePackages = config.environment.xfce.excludePackages;
in
{
@ -69,10 +70,17 @@ in
description = lib.mdDoc "Enable the XFCE screensaver.";
};
};
environment.xfce.excludePackages = mkOption {
default = [];
example = literalExpression "[ pkgs.xfce.xfce4-volumed-pulse ]";
type = types.listOf types.package;
description = lib.mdDoc "Which packages XFCE should exclude from the default environment";
};
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs.xfce // pkgs; [
environment.systemPackages = utils.removePackagesByName (with pkgs.xfce // pkgs; [
glib # for gsettings
gtk3.out # gtk-update-icon-cache
@ -121,7 +129,7 @@ in
] ++ optionals (!cfg.noDesktop) [
xfce4-panel
xfdesktop
] ++ optional cfg.enableScreensaver xfce4-screensaver;
] ++ optional cfg.enableScreensaver xfce4-screensaver) excludePackages;
programs.xfconf.enable = true;
programs.thunar.enable = true;
@ -165,9 +173,9 @@ in
programs.zsh.vteIntegration = mkDefault true;
# Systemd services
systemd.packages = with pkgs.xfce; [
systemd.packages = utils.removePackagesByName (with pkgs.xfce; [
xfce4-notifyd
];
]) excludePackages;
security.pam.services.xfce4-screensaver.unixAuth = cfg.enableScreensaver;
};