about summary refs log tree commit diff
path: root/pkgs/games/default.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2017-11-20 19:39:05 +0100
committeraszlig <aszlig@nix.build>2017-11-21 07:44:45 +0100
commit107f6d646622024ac244e939651cfda02eefec59 (patch)
treea636ac15ec1aa9608b6f0783809ea566afeb58cf /pkgs/games/default.nix
parent691d7b82ce27d9540c2ef8b807621dc53c359919 (diff)
pkgs/games: Pass build-support to the top-level
We're going to add a test for our buildSandbox function, so we need to
have the buildSandbox function available from outside the package scope
and thus within the resulting attribute set.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games/default.nix')
-rw-r--r--pkgs/games/default.nix30
1 files changed, 16 insertions, 14 deletions
diff --git a/pkgs/games/default.nix b/pkgs/games/default.nix
index 555d6b6e..f920089d 100644
--- a/pkgs/games/default.nix
+++ b/pkgs/games/default.nix
@@ -17,6 +17,13 @@ let
     }
   '' else configFilePath;
 
+  mkBuildSupport = super: let
+    self = import ./build-support {
+      inherit (super) config;
+      callPackage = pkgs.lib.callPackageWith (super // self);
+    };
+  in self;
+
   baseModule = { lib, ... }: {
     options = {
       packages = lib.mkOption {
@@ -26,22 +33,17 @@ let
       };
     };
 
-    config._module.args.pkgs = let
-      mkBuildSupport = super: let
-        self = import ./build-support {
-          inherit (super) config;
-          callPackage = lib.callPackageWith (super // self);
-        };
-      in self;
-    in pkgs // (mkBuildSupport pkgs) // {
+    config._module.args.pkgs = pkgs // (mkBuildSupport pkgs) // {
       pkgsi686Linux = pkgs.pkgsi686Linux
                    // (mkBuildSupport pkgs.pkgsi686Linux);
     };
   };
 
-in (pkgs.lib.evalModules {
-  modules = [
-    (if config == null then configFilePath else config)
-    baseModule ./humblebundle ./steam ./itch
-  ];
-}).config.packages
+  packages = (pkgs.lib.evalModules {
+    modules = [
+      (if config == null then configFilePath else config)
+      baseModule ./humblebundle ./steam ./itch
+    ];
+  }).config.packages;
+
+in packages // mkBuildSupport pkgs