New modules for container managment
This commit is contained in:
parent
0a48b3d817
commit
93e9d585cb
7 changed files with 121 additions and 2 deletions
48
modules/virtualisation/proxmox.nix
Normal file
48
modules/virtualisation/proxmox.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{ 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue