blob: e2e1a0f9d676ad7f9ff748c1dc1ef0ecf3c7e227 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
{
config,
lib,
inputs,
...
}:
let
cfg = config.os.vms;
sharedSecrets = [
{
tag = "shared-secrets";
proto = "virtiofs";
source = "/etc/nixos/secrets";
mountPoint = "/etc/nixos/secrets";
}
];
in
{
imports = [ inputs.microvm.nixosModules.host ];
options.os.vms = {
net-core.enable = lib.mkEnableOption "enables the net-core virtual machine";
};
config = lib.mkMerge [
(lib.mkIf cfg.net-core.enable {
microvm.vms.net-core = {
autostart = true;
config = {
imports = [ ../vms/net-core.nix ];
microvm.shares = sharedSecrets;
};
};
})
];
}
|