nixpkgs/default.nix
Eelco Dolstra cfa218a26b * Move the list of modules into a separate file. This file could be
generated by some find/grep hackery as Nicolas suggested.

svn path=/nixos/branches/modular-nixos/; revision=15743
2009-05-27 09:09:17 +00:00

49 lines
1.1 KiB
Nix

let
fromEnv = name: default:
let env = builtins.getEnv name; in
if env == "" then default else env;
configuration = import (fromEnv "NIXOS_CONFIG" /etc/nixos/configuration.nix);
nixpkgs = fromEnv "NIXPKGS" /etc/nixos/nixpkgs;
pkgs = import nixpkgs {system = builtins.currentSystem;};
configComponents = [
configuration
(import ./system/options.nix)
];
# Make a configuration object from which we can retrieve option
# values.
config =
pkgs.lib.fixOptionSets
pkgs.lib.mergeOptionSets
pkgs configComponents;
optionDeclarations =
pkgs.lib.fixOptionSetsFun
pkgs.lib.filterOptionSets
pkgs configComponents
config;
in
{
# Optionally check wether all config values have corresponding
# option declarations.
system = pkgs.checker config.system.build.system
config.environment.checkConfigurationOptions
optionDeclarations config;
nix = config.environment.nix;
nixFallback = pkgs.nixUnstable;
manifests = config.installer.manifests; # exported here because nixos-rebuild uses it
tests = config.tests;
}