summary refs log tree commit diff
path: root/nixos/default.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-10 13:28:20 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-10 13:28:20 +0200
commit5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010 (patch)
treea6c0f605be6de3f372ae69905b331f9f75452da7 /nixos/default.nix
parent6070bc016bd2fd945b04347e25cfd3738622d2ac (diff)
Move all of NixOS to nixos/ in preparation of the repository merge
Diffstat (limited to 'nixos/default.nix')
-rw-r--r--nixos/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/nixos/default.nix b/nixos/default.nix
new file mode 100644
index 0000000000000..d38e70d21f941
--- /dev/null
+++ b/nixos/default.nix
@@ -0,0 +1,44 @@
+{ configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" <nixos-config>
+, system ? builtins.currentSystem
+, nixpkgs ? <nixpkgs>
+}:
+
+let
+
+  eval = import ./lib/eval-config.nix {
+    inherit system nixpkgs;
+    modules = [ configuration ];
+  };
+
+  inherit (eval) config pkgs;
+
+  # This is for `nixos-rebuild build-vm'.
+  vmConfig = (import ./lib/eval-config.nix {
+    inherit system nixpkgs;
+    modules = [ configuration ./modules/virtualisation/qemu-vm.nix ];
+  }).config;
+
+  # This is for `nixos-rebuild build-vm-with-bootloader'.
+  vmWithBootLoaderConfig = (import ./lib/eval-config.nix {
+    inherit system nixpkgs;
+    modules =
+      [ configuration
+        ./modules/virtualisation/qemu-vm.nix
+        { virtualisation.useBootLoader = true; }
+      ];
+  }).config;
+
+in
+
+{
+  inherit eval config;
+
+  system = config.system.build.toplevel;
+
+  vm = vmConfig.system.build.vm;
+
+  vmWithBootLoader = vmWithBootLoaderConfig.system.build.vm;
+
+  # The following are used by nixos-rebuild.
+  nixFallback = pkgs.nixUnstable;
+}