From 64a204d1a7300d60aa4665415ab043e42cde0f74 Mon Sep 17 00:00:00 2001 From: illustris Date: Fri, 18 Mar 2022 16:18:00 +0530 Subject: [PATCH] nixos/proxmox-lxc: use hostname provided by proxmox --- nixos/modules/virtualisation/proxmox-lxc.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/modules/virtualisation/proxmox-lxc.nix b/nixos/modules/virtualisation/proxmox-lxc.nix index 3913b474afb..9b9f99e5b81 100644 --- a/nixos/modules/virtualisation/proxmox-lxc.nix +++ b/nixos/modules/virtualisation/proxmox-lxc.nix @@ -20,6 +20,15 @@ with lib; configuration from proxmox. ''; }; + manageHostName = mkOption { + type = 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 = @@ -50,6 +59,8 @@ with lib; useDHCP = false; useHostResolvConf = false; useNetworkd = true; + # pick up hostname from /etc/hostname generated by proxmox + hostName = mkIf (!cfg.manageHostName) (mkForce ""); }; services.openssh = {