mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 06:14:57 +01:00
98cce35041
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
46 lines
1,007 B
Nix
46 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;
|
|
}
|