infra/ansible/files/nixos-template-config.nix
2026-06-21 13:39:36 -05:00

32 lines
929 B
Nix

# NixOS template configuration for Proxmox cloud-init VMs.
# Built into a qcow2 image and imported as a Proxmox template.
{ config, pkgs, lib, ... }:
{
# Boot
boot.loader.grub.device = "/dev/sda";
boot.loader.timeout = 0;
# Network — cloud-init will configure (override proxmox-image default)
networking.useDHCP = lib.mkForce true;
networking.hostName = "nixos";
# SSH for Ansible
services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = lib.mkForce "prohibit-password";
# QEMU guest agent for Proxmox integration
services.qemuGuest.enable = true;
# cloud-init — consumes Proxmox config drive (hostname, SSH keys, network)
services.cloud-init.enable = true;
services.cloud-init.network.enable = true;
# Python for Ansible management
environment.systemPackages = [ pkgs.python3 ];
# Minimal system
documentation.enable = false;
system.stateVersion = "26.05";
}