aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2009-05-27 09:00:45 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2009-05-27 09:00:45 +0000
commit98cce35041be0fef2f6289297b076bdca0283640 (patch)
tree0ecbb11198a8f520c28f8dee8dfc1bc5dfd85128 /default.nix
parent7ac0b3aaeadb1607662f16a19a9f693de9ef0bca (diff)
* 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
Diffstat (limited to '')
-rw-r--r--default.nix46
1 files changed, 29 insertions, 17 deletions
diff --git a/default.nix b/default.nix
index 30eff6c2e6a..ebb9110eb35 100644
--- a/default.nix
+++ b/default.nix
@@ -8,27 +8,39 @@ let
nixpkgs = fromEnv "NIXPKGS" /etc/nixos/nixpkgs;
- system = import system/system.nix { inherit configuration 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
-{ inherit (system)
- activateConfiguration
- bootStage2
- etc
- grubMenuBuilder
- kernel
- modulesTree
- system
- systemPath
- config
- ;
-
- nix = system.config.environment.nix;
+{
+
+ system = config.system.build.system;
+
+ nix = config.environment.nix;
- nixFallback = (import nixpkgs {}).nixUnstable;
+ nixFallback = pkgs.nixUnstable;
- manifests = system.config.installer.manifests; # exported here because nixos-rebuild uses it
+ manifests = config.installer.manifests; # exported here because nixos-rebuild uses it
- tests = system.config.tests;
+ tests = config.tests;
}