nixpkgs/pkgs/build-support/usernixos/eval-config.nix
Lluís Batlle i Rossell 68b5044cc0 Adding 'usernixos', where I start a modular kind-of-nixos that can go into
"nix-env -i" profiles, as a container for flexible configuration at the style
of nixos, to be defined in .nixpkgs/config.nix, with the main target of
generating an activation script.


svn path=/nixpkgs/trunk/; revision=33445
2012-03-27 20:33:49 +00:00

32 lines
876 B
Nix

{ system ? builtins.currentSystem
, pkgs ? null
, baseModules ? import ./module-list.nix
, extraArgs ? {}
, modules
}:
let extraArgs_ = extraArgs; pkgs_ = pkgs; system_ = system; in
rec {
# These are the NixOS modules that constitute the system configuration.
configComponents = modules ++ baseModules;
# Merge the option definitions in all modules, forming the full
# system configuration. It's not checked for undeclared options.
systemModule =
pkgs.lib.fixMergeModules configComponents extraArgs;
optionDefinitions = systemModule.config;
optionDeclarations = systemModule.options;
inherit (systemModule) options;
# These are the extra arguments passed to every module. In
# particular, Nixpkgs is passed through the "pkgs" argument.
extraArgs = extraArgs_ // {
inherit pkgs modules baseModules;
};
config = systemModule.config;
}