forked from SaumonNet/proxmox-nixos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
49 lines (40 loc) · 1.03 KB
/
default.nix
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
38
39
40
41
42
43
44
45
46
47
48
49
{
config,
lib,
pkgs,
...
}:
let
cfg = config.virtualisation.proxmox;
in
with lib;
{
meta.maintainers = with maintainers; [
julienmalka
camillemndn
];
options.virtualisation.proxmox = (import ./options.nix { inherit config lib; }).options // {
node = mkOption {
type = types.str;
description = "The cluster node name.";
};
name = mkOption {
type = types.str;
default = config.networking.hostName;
description = "Set a name for the VM. Only used on the configuration web interface.";
};
autoInstall = mkEnableOption "Automatically install the NixOS configuration on the VM";
iso = mkOption {
default = null;
type = types.package;
description = "Iso that will be inserted into the VM. Not compatible with the autoInstall option";
};
};
config = lib.mkIf cfg.autoInstall {
virtualisation.proxmox.iso =
let
isoConfig = import ./iso.nix config.system.build;
in
(pkgs.nixos isoConfig).config.system.build.isoImage;
};
}