summary refs log tree commit diff
path: root/nixos/default.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2021-12-17 12:41:12 +0100
committerRobert Hensing <robert@roberthensing.nl>2021-12-17 13:17:37 +0100
commit8fd49c116bcd256263c7aad8ca5d4b7fa10d4ca2 (patch)
treeea08d17fefc88b99f8b5a02d10e018c15e17326a /nixos/default.nix
parent8086f8658e1ad806c821519632393535992acc8d (diff)
nixos/default.nix: Use extendModules
Diffstat (limited to 'nixos/default.nix')
-rw-r--r--nixos/default.nix35
1 files changed, 16 insertions, 19 deletions
diff --git a/nixos/default.nix b/nixos/default.nix
index c11872f1441ab..01605e1d57726 100644
--- a/nixos/default.nix
+++ b/nixos/default.nix
@@ -10,25 +10,22 @@ let
   };
 
   # This is for `nixos-rebuild build-vm'.
-  vmConfig = (import ./lib/eval-config.nix {
-    inherit system;
-    modules = [ configuration ./modules/virtualisation/qemu-vm.nix ];
-  }).config;
+  vm = eval.extendModules {
+    modules = [ ./modules/virtualisation/qemu-vm.nix ];
+  };
 
   # This is for `nixos-rebuild build-vm-with-bootloader'.
-  vmWithBootLoaderConfig = (import ./lib/eval-config.nix {
-    inherit system;
-    modules =
-      [ configuration
-        ./modules/virtualisation/qemu-vm.nix
-        { virtualisation.useBootLoader = true; }
-        ({ config, ... }: {
-          virtualisation.useEFIBoot =
-            config.boot.loader.systemd-boot.enable ||
-            config.boot.loader.efi.canTouchEfiVariables;
-        })
-      ];
-  }).config;
+  vmWithBootLoader = vm.extendModules {
+    modules = [
+      ({ config, ... }: {
+        _file = "nixos/default.nix##vmWithBootLoader";
+        virtualisation.useBootLoader = true;
+        virtualisation.useEFIBoot =
+          config.boot.loader.systemd-boot.enable ||
+          config.boot.loader.efi.canTouchEfiVariables;
+      })
+    ];
+  };
 
 in
 
@@ -37,7 +34,7 @@ in
 
   system = eval.config.system.build.toplevel;
 
-  vm = vmConfig.system.build.vm;
+  vm = vm.config.system.build.vm;
 
-  vmWithBootLoader = vmWithBootLoaderConfig.system.build.vm;
+  vmWithBootLoader = vmWithBootLoader.config.system.build.vm;
 }