diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-12-17 12:41:12 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2021-12-17 13:17:37 +0100 |
commit | 8fd49c116bcd256263c7aad8ca5d4b7fa10d4ca2 (patch) | |
tree | ea08d17fefc88b99f8b5a02d10e018c15e17326a /nixos/default.nix | |
parent | 8086f8658e1ad806c821519632393535992acc8d (diff) |
nixos/default.nix: Use extendModules
Diffstat (limited to 'nixos/default.nix')
-rw-r--r-- | nixos/default.nix | 35 |
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; } |