diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index 69cf98321720..ae1fde555a9c 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -363,15 +363,6 @@ in /* gnome-boxes */ ] config.environment.gnome3.excludePackages); - # Enable default programs - programs.evince.enable = mkDefault true; - programs.file-roller.enable = mkDefault true; - programs.geary.enable = mkDefault true; - programs.gnome-disks.enable = mkDefault true; - programs.gnome-terminal.enable = mkDefault true; - programs.seahorse.enable = mkDefault true; - services.gnome3.sushi.enable = mkDefault true; - # Let nautilus find extensions # TODO: Create nautilus-with-extensions package environment.sessionVariables.NAUTILUS_EXTENSION_DIR = "${config.system.path}/lib/nautilus/extensions-3.0"; @@ -384,6 +375,25 @@ in ]; }) + # Enable default program modules + # Since some of these have a corresponding package, we only + # enable that program module if the package hasn't been excluded + # through `environment.gnome3.excludePackages` + ( + let + notExcluded = pkg: mkDefault (!(lib.elem pkg config.environment.gnome3.excludePackages)); + in + with pkgs.gnome3; + { + programs.evince.enable = notExcluded evince; + programs.file-roller.enable = notExcluded file-roller; + programs.geary.enable = notExcluded geary; + programs.gnome-disks.enable = notExcluded gnome-disk-utility; + programs.gnome-terminal.enable = notExcluded gnome-terminal; + programs.seahorse.enable = notExcluded seahorse; + services.gnome3.sushi.enable = notExcluded sushi; + }) + (mkIf serviceCfg.games.enable { environment.systemPackages = (with pkgs.gnome3; removePackagesByName [ aisleriot atomix five-or-more four-in-a-row gnome-chess gnome-klotski