Skip to content

Deploy a minimum NixOS VM on Proxmox at speed. [maintainer=@piyoki]

License

Notifications You must be signed in to change notification settings

NixOS-Pilots/nixos-proxmox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❄️ NixOS on Proxmox

Deploy a minimum NixOS VM on Proxmox at speed

License lastcommit


Note

The image can be build locally, or by using the included GitHub action.

Credit to @Mayniklas, @NixOS-Pilots and inspired by Mayniklas/nixos-proxmox.

Table of Contents

Prerequisites

Update user ssh-keys

In ./system/users.nix, update the keyFiles attribute with your own ssh key.

{
  keyFiles = [
    (pkgs.fetchurl {
      # replace <github_user> with your own ssh key!
      # command to generate the hash:
      # nix-prefetch-url --type sha256 'https://github.com/<github_user>.gpg' | xargs nix hash to-sri --type sha256
      url = "https://github.com/<github_user>.keys";
      hash = "sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    })
  ];
}

Deployment

Build the image

# build VMA image
nix build .#proxmox-image

Upload the image to Proxmox

Upload the image to a location, that is accessible by Proxmox.

# scp build artifact to Proxmox
scp ./result/*.vma.zst root@<proxmox-ip>:/root/

Create a VM using qmrestore

# import the VM from VMA image
# unique is required to randomize the MAC address of the network interface
# storage is the name of the storage, where we create the VM
qmrestore ./vzdump-qemu-nixos-*.vma.zst 999 --unique true --storage <storage, e.g. local-lvm>

Apply config changes

nixos-rebuild switch --flake .#proxmox-host

Contribution

References

About

Deploy a minimum NixOS VM on Proxmox at speed. [maintainer=@piyoki]

Topics

Resources

License

Stars

Watchers

Forks