* Move the config evaluation into a separate expression so that it can
be reused, e.g. for building the CD/DVD. svn path=/nixos/branches/modular-nixos/; revision=15744
This commit is contained in:
parent
cfa218a26b
commit
5b7f7d2de1
21
default.nix
21
default.nix
|
@ -9,29 +9,14 @@ let
|
||||||
nixpkgs = fromEnv "NIXPKGS" /etc/nixos/nixpkgs;
|
nixpkgs = fromEnv "NIXPKGS" /etc/nixos/nixpkgs;
|
||||||
|
|
||||||
pkgs = import nixpkgs {system = builtins.currentSystem;};
|
pkgs = import nixpkgs {system = builtins.currentSystem;};
|
||||||
|
|
||||||
configComponents = [
|
|
||||||
configuration
|
|
||||||
(import ./system/options.nix)
|
|
||||||
];
|
|
||||||
|
|
||||||
# Make a configuration object from which we can retrieve option
|
inherit
|
||||||
# values.
|
(import ./lib/eval-config.nix {inherit configuration pkgs;})
|
||||||
config =
|
config optionDeclarations;
|
||||||
pkgs.lib.fixOptionSets
|
|
||||||
pkgs.lib.mergeOptionSets
|
|
||||||
pkgs configComponents;
|
|
||||||
|
|
||||||
optionDeclarations =
|
|
||||||
pkgs.lib.fixOptionSetsFun
|
|
||||||
pkgs.lib.filterOptionSets
|
|
||||||
pkgs configComponents
|
|
||||||
config;
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# Optionally check wether all config values have corresponding
|
# Optionally check wether all config values have corresponding
|
||||||
# option declarations.
|
# option declarations.
|
||||||
system = pkgs.checker config.system.build.system
|
system = pkgs.checker config.system.build.system
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
# From an end-user configuration file (`configuration'), build a NixOS
|
||||||
|
# configuration object (`config') from which we can retrieve option
|
||||||
|
# values.
|
||||||
|
|
||||||
|
{configuration, pkgs}:
|
||||||
|
|
||||||
|
rec {
|
||||||
|
configComponents = [
|
||||||
|
configuration
|
||||||
|
(import ../system/options.nix)
|
||||||
|
];
|
||||||
|
|
||||||
|
config =
|
||||||
|
pkgs.lib.fixOptionSets
|
||||||
|
pkgs.lib.mergeOptionSets
|
||||||
|
pkgs configComponents;
|
||||||
|
|
||||||
|
optionDeclarations =
|
||||||
|
pkgs.lib.fixOptionSetsFun
|
||||||
|
pkgs.lib.filterOptionSets
|
||||||
|
pkgs configComponents
|
||||||
|
config;
|
||||||
|
}
|
Loading…
Reference in New Issue