From 79a4c941e58cd1c2288e623486d87ea146e83df8 Mon Sep 17 00:00:00 2001 From: MichaelFisher1997 Date: Sun, 8 Mar 2026 05:16:19 +0000 Subject: [PATCH] fix: enable cloud-init networking in NixOS template Freshly recreated VMs were reachable but did not accept the injected SSH key, which indicates Proxmox cloud-init settings were not being applied. Enable cloud-init and cloud-init network handling in the base template so static IPs, hostname, ciuser, and SSH keys take effect on first boot. --- nixos/template-base/configuration.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/template-base/configuration.nix b/nixos/template-base/configuration.nix index 752c636..a045fcc 100644 --- a/nixos/template-base/configuration.nix +++ b/nixos/template-base/configuration.nix @@ -10,7 +10,8 @@ in ./hardware-configuration.nix; networking.hostName = "k8s-base-template"; - networking.useDHCP = lib.mkDefault true; + networking.useDHCP = false; + networking.useNetworkd = true; networking.nameservers = [ "1.1.1.1" "8.8.8.8" ]; boot.loader.systemd-boot.enable = lib.mkForce false; @@ -20,6 +21,8 @@ in }; services.qemuGuest.enable = true; + services.cloud-init.enable = true; + services.cloud-init.network.enable = true; services.openssh.enable = true; services.openssh.settings = { PasswordAuthentication = false;