The flake offers packages that generate Proxmox VM templates using nixos-generators.
The resulting vma
files can be directly imported into Proxmox and used, eliminating the need to manually configure a VM and install NixOS.
Please note the EFI secure boot complications that need to be handled when not using the deploy-image script.
The templates use an enhanced format based on the Nixpkgs Proxmox image. This enhanced template enables the creation of SCSI disks and other smaller improvements.
Optimized VM template for x86_64 systems that aligns with the hardware of my main Proxmox host.
- Machine: q35 (PCIe-based architecture)
- Storage: SCSI with optimizations (discard, I/O thread, SSD) for optimal M.2 storage usage
- Cloud-init enabled
- UEFI boot
- Extended kernel modules like ...
- Storage: virtio_scsi, scsi_mod, sd_mod
- Memory: virtio_balloon (dynamic memory allocation)
- Random: virtio_rng (entropy from host)
- USB: Full stack (1.1 through 3.0) support
Default VM template for x86_64 systems, provides highest compatibility. I started with the template, so a few of my VMs are still running on it.
- Machine: i440fx
- Storage: VirtIO-based
- Cloud-init enabled
Specialized template for Nix remote builders.
- Based on proxmox-x86-optimized
- Includes builder-specific configurations
- Includes remote builder role configuration
- Supports building ARM packages, but it is very slow. Helpful for getting started with ARM systems until a host-specific ARM builder can be booted.
Template used for virtual machines running on my Raspberry Pi using Proxmox-Port.
- Based on standard nixpkgs image
- Configured according to Proxmox ARM port specifications
- Suitable for ARM-based Proxmox installations
Templates can be built using the standard Nix commands:
nix build .#proxmox-x86-optimized
deploy-image automates the VM creation process inside proxmox:
- Uploads template to Proxmox host
- Creates/Restores the created VMA file with specified ID
- Recreates the EFI disk to prevent secure boot issues.
The build VM can be used immediately after deployment.
1-99
: Reserved for cluster/system use100-999
: Production VMs1000-1999
: Templates2000-2999
: Development/Test VMs9000-9999
: Temporary/Clone VMs
100-109
: DNS/DHCP110-119
: Authentication/Directory (LDAP, AD)120-129
: Monitoring/Logging130-139
: Build/CI Services140-149
: Backup Services150-159
: Storage Services160-169
: Network Services170-179
: Security Services180-189
: Management Tools190-199
: Other Infrastructure
200-219
: Web Services220-239
: Database Servers240-259
: Mail Services260-279
: Media Services280-299
: Home Automation300-319
: Documentation/Wiki320-339
: Communication Services340-359
: File Sharing360-379
: Development Tools380-399
: Other Applications
400-419
: Kubernetes Nodes420-439
: Docker Hosts440-459
: Container Management460-479
: Container Registry480-499
: Other Container Services
500-519
: Primary Storage520-539
: Backup Storage540-559
: Archive Storage560-579
: Object Storage580-599
: Other Storage
600-619
: Firewalls/Routers620-639
: VPN Services640-659
: Load Balancers660-679
: Proxy Services680-699
: Other Network Services
700-749
: Analytics/Metrics750-799
: AI/ML Services800-849
: IoT Services850-899
: Custom Solutions
900-999
: Future Use/Expansion
1000-1099
: Linux Distribution Templates1100-1199
: Windows Templates1200-1299
: Application Templates1300-1399
: Container Templates1400-1499
: Custom Templates1500-1999
: Reserved for Future Templates
2000-2199
: Development Environment2200-2399
: Testing Environment2400-2599
: Staging Environment2600-2799
: QA Environment2800-2999
: Experimental VMs
9000-9499
: Clones9500-9699
: Testing9700-9899
: Temporary Workloads9900-9999
: Emergency/Recovery
- Leave gaps between used IDs for future expansion
- Critical infrastructure VMs (like storage, backup) should maintain existing IDs if already established
- Document any deviations from this scheme
- Consider using tags in addition to ID ranges for better organization
{purpose}-{nn}
Example: dns-01
, k8s-01
, db-01
dns
: DNS Serversdhcp
: DHCP Servicesfw
: Firewallsproxy
: Reverse Proxiesmon
: Monitoring Servicesbackup
: Backup Servicesnfs
: File Serversgit
: Git Serversldap
: Directory Servicesvpn
: VPN Servicesbuild
: Build Servers/CI
web
: Web Serversapp
: Application Serversdb
: Database Serverscache
: Caching Servicesmail
: Mail Serversci
: CI/CD Servicesdocker
: Docker Hostsk8s
: Kubernetes Nodesmqtt
: Message Brokers
nas
: Network Attached Storagesan
: Storage Area Networkstore
: General Storagearchive
: Archive Storage
plex
: Media Serversha
: Home Assistantcam
: Camera/Surveillancemedia
: Media Servicespi
: Pi-hole/DNS Filtering
- Two-digit number starting with 01
- Example: web:01, web:02
- Use lowercase only
- No special characters except colon (:)
- Keep names short but meaningful
- Be consistent with abbreviations
- Document any exceptions
- Use sequential numbering
# Infrastructure
dns-01 # Primary DNS
proxy-01 # Main reverse proxy
build-01 # Build server
# Applications
web-01 # Primary web server
db-01 # Main database
app-01 # Application server
# Storage
nas-01 # Primary NAS
store-01 # General storage
# Media/Home
plex-01 # Media server
ha-01 # Home Assistant
- Names should be easily identifiable
- Purpose should be clear from the name
- Numbers allow for multiple instances
- Avoid environment prefixes unless needed (dev/prod)
- Consider DNS implications when naming
- Keep consistent across documentation and configurations