Making nixos handle the nixpkgs 'platform' parameter.

svn path=/nixos/trunk/; revision=20274
This commit is contained in:
Lluís Batlle i Rossell 2010-02-27 18:37:12 +00:00
parent bc4e159d0e
commit 9002335101
2 changed files with 17 additions and 7 deletions

View File

@ -47,17 +47,20 @@ rec {
pkgs =
if pkgs_ != null
then pkgs_
else import nixpkgs {
inherit system;
config =
(import ./eval-config.nix {
else import nixpkgs (
let
nixpkgsOptions = (import ./eval-config.nix {
inherit system nixpkgs services extraArgs modules;
# For efficiency, leave out most NixOS modules; they don't
# define nixpkgs.config, so it's pointless to evaluate them.
baseModules = [ ../modules/misc/nixpkgs.nix ];
pkgs = import nixpkgs { inherit system; config = {}; };
}).optionDefinitions.nixpkgs.config;
};
}).optionDefinitions.nixpkgs;
in
{
inherit system;
inherit (nixpkgsOptions) config platform;
});
# Optionally check wether all config values have corresponding
# option declarations.

View File

@ -13,5 +13,12 @@
'';
};
nixpkgs.platform = pkgs.lib.mkOption {
default = pkgs.platforms.pc;
description = ''
The platform for the Nix Packages collection.
'';
};
};
}