nix/modules/virtualisation/proxmox.nix

56 lines
1.1 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.proxmox;
in
{
options.proxmox = {
enable = lib.mkEnableOption "If this host is running inside Proxmox";
privileged = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable privileged mounts
'';
};
manageNetwork = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to manage network interfaces through nix options
When false, systemd-networkd is enabled to accept network
configuration from proxmox.
'';
};
manageHostName = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to manage hostname through nix options
When false, the hostname is picked up from /etc/hostname
populated by proxmox.
'';
};
};
config = lib.mkIf cfg.enable {
proxmoxLXC = {
enable = true;
privileged = cfg.privileged;
manageNetwork = cfg.manageNetwork;
manageHostName = cfg.manageHostName;
};
serverNodeUsers.enable = true;
};
}