Skip to content

Commit 6510ec5

Browse files
committed
nixos: Make system.build.vm a standard attribute based on vmVariant
1 parent 4014fb6 commit 6510ec5

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

flake.nix

-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@
4545
system.nixos.versionSuffix =
4646
".${final.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}.${self.shortRev or "dirty"}";
4747
system.nixos.revision = final.mkIf (self ? rev) self.rev;
48-
49-
system.build = {
50-
vm = lib.mkDefault config.virtualisation.vmVariant.system.build.vm;
51-
vmWithBootLoader = lib.mkDefault config.virtualisation.vmVariantWithBootLoader.system.build.vm;
52-
};
5348
})
5449
];
5550
});

nixos/default.nix

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ in
1616

1717
system = eval.config.system.build.toplevel;
1818

19-
vm = eval.config.virtualisation.vmVariant.system.build.vm;
20-
21-
vmWithBootLoader = eval.config.virtualisation.vmVariantWithBootLoader.system.build.vm;
19+
inherit (eval.config.system.build) vm vmWithBootLoader;
2220
}

nixos/modules/virtualisation/build-vm.nix

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ extendModules, lib, ... }:
1+
{ config, extendModules, lib, ... }:
22
let
33

44
inherit (lib)
@@ -43,4 +43,13 @@ in
4343
};
4444

4545
};
46+
47+
config = {
48+
49+
system.build = {
50+
vm = lib.mkDefault config.virtualisation.vmVariant.system.build.vm;
51+
vmWithBootLoader = lib.mkDefault config.virtualisation.vmVariantWithBootLoader.system.build.vm;
52+
};
53+
54+
};
4655
}

0 commit comments

Comments
 (0)