Flake-based NixOS template for VMs (x86_64-linux only).
Boot the NixOS installer and run:
curl -sL https://raw.githubusercontent.com/Spokelax/nixos-template/main/install.sh | sudo bashSupports unattended install with CLI options. Run with --help for details.
Default hostname is nixos-template (for Proxmox template creation). Override if installing directly.
For custom setups:
- Partition - GPT with 512MB ESP + 1GB boot + root
- Format - FAT32 EFI, ext4 boot, ext4 root
- Mount -
/mnt,/mnt/boot,/mnt/boot/efi - Clone -
git clone https://github.com/Spokelax/nixos-template.git /mnt/etc/nixos - Hardware config -
nixos-generate-config --show-hardware-config > /mnt/etc/nixos/hosts/hardware.nix - Host config - Create
hosts/config.nix(seehosts/config.example.nix)
Tip
Default channel is nixos-unstable. To use stable, edit flake.nix before install:
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
- Install -
nixos-install --flake /mnt/etc/nixos#hostname
See hosts/README.md for:
- Cloned VM setup (onboarding.sh)
- Host configuration
- Adding services