nixpkgs/default.nix
Eelco Dolstra 98cce35041 * Turn the top-level derivation of a NixOS configuration ("system")
into a NixOS module (modules/system/activation/top-level.nix -
  couldn't think of a better name).  The top-level derivation is
  returned in config.system.build.system.
* Inlined system.sh in top-level.nix so that we don't have to pass
  everything through environment variables.

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

47 lines
1,007 B
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;};
#system = import system/system.nix { inherit configuration nixpkgs; };
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
{
system = config.system.build.system;
nix = config.environment.nix;
nixFallback = pkgs.nixUnstable;
manifests = config.installer.manifests; # exported here because nixos-rebuild uses it
tests = config.tests;
}