From afdeb406b003b89f7aafa6229b4699b654c8aca8 Mon Sep 17 00:00:00 2001 From: WORLDofPEACE Date: Tue, 6 Oct 2020 07:37:47 -0400 Subject: [PATCH] nixos/gnome3: fixup unconditional code --- .../services/x11/desktop-managers/gnome3.nix | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index ae1fde555a9c..f0ed0d421ec7 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -53,6 +53,8 @@ let flashbackEnabled = cfg.flashback.enableMetacity || length cfg.flashback.customSessions > 0; + notExcluded = pkg: mkDefault (!(lib.elem pkg config.environment.gnome3.excludePackages)); + in { @@ -363,6 +365,18 @@ in /* gnome-boxes */ ] config.environment.gnome3.excludePackages); + # 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` + programs.evince.enable = notExcluded pkgs.gnome3.evince; + programs.file-roller.enable = notExcluded pkgs.gnome3.file-roller; + programs.geary.enable = notExcluded pkgs.gnome3.geary; + programs.gnome-disks.enable = notExcluded pkgs.gnome3.gnome-disk-utility; + programs.gnome-terminal.enable = notExcluded pkgs.gnome3.gnome-terminal; + programs.seahorse.enable = notExcluded pkgs.gnome3.seahorse; + services.gnome3.sushi.enable = notExcluded pkgs.gnome3.sushi; + # Let nautilus find extensions # TODO: Create nautilus-with-extensions package environment.sessionVariables.NAUTILUS_EXTENSION_DIR = "${config.system.path}/lib/nautilus/extensions-3.0"; @@ -375,25 +389,6 @@ 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