Move most extra args out of eval-config.nix

This commit is contained in:
Shea Levy
2015-03-12 23:42:57 +01:00
committed by Nicolas B. Pierron
parent 0a0a29fd0b
commit f69ce50529
4 changed files with 27 additions and 17 deletions
+3 -17
View File
@@ -35,6 +35,7 @@ let
key = _file; key = _file;
config = { config = {
nixpkgs.system = lib.mkDefault system_; nixpkgs.system = lib.mkDefault system_;
__internal.args.pkgs = lib.mkIf (pkgs_ != null) (lib.mkForce pkgs_);
}; };
}; };
@@ -56,23 +57,8 @@ in rec {
# the 64-bit package anyway. However, it would be cleaner to respect # the 64-bit package anyway. However, it would be cleaner to respect
# nixpkgs.config here. # nixpkgs.config here.
extraArgs = extraArgs_ // { extraArgs = extraArgs_ // {
inherit pkgs modules baseModules; inherit modules baseModules;
modulesPath = ../modules;
pkgs_i686 = import ./nixpkgs.nix { system = "i686-linux"; config.allowUnfree = true; };
utils = import ./utils.nix pkgs;
}; };
pkgs = inherit (config.__internal.args) pkgs;
if pkgs_ != null
then pkgs_
else import ./nixpkgs.nix (
let
system = if nixpkgsOptions.system != "" then nixpkgsOptions.system else system_;
nixpkgsOptions = config.nixpkgs;
in
{
inherit system;
inherit (nixpkgsOptions) config;
});
} }
+14
View File
@@ -0,0 +1,14 @@
{ lib, pkgs, config, ... }:
{
__internal.args = {
modulesPath = ../.;
pkgs_i686 = import ../../lib/nixpkgs.nix {
system = "i686-linux";
config.allowUnfree = true;
};
utils = import ../../lib/utils.nix pkgs;
};
}
+9
View File
@@ -60,6 +60,7 @@ in
nixpkgs.system = mkOption { nixpkgs.system = mkOption {
type = types.str; type = types.str;
default = builtins.currentSystem;
description = '' description = ''
Specifies the Nix platform type for which NixOS should be built. Specifies the Nix platform type for which NixOS should be built.
If unset, it defaults to the platform type of your host system. If unset, it defaults to the platform type of your host system.
@@ -69,4 +70,12 @@ in
}; };
}; };
config = {
__internal.args.pkgs = import ../../lib/nixpkgs.nix {
system = config.nixpkgs.system;
inherit (config.nixpkgs) config;
};
};
} }
+1
View File
@@ -44,6 +44,7 @@
./installer/tools/tools.nix ./installer/tools/tools.nix
./misc/assertions.nix ./misc/assertions.nix
./misc/crashdump.nix ./misc/crashdump.nix
./misc/extra-arguments.nix
./misc/ids.nix ./misc/ids.nix
./misc/lib.nix ./misc/lib.nix
./misc/locate.nix ./misc/locate.nix