GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ilude/nix: Setup a NixOS VM on Proxmox

BranchesTags
Open more actions menu

Latest commit

 

History

124 Commits
124 Commits

Folders and files

NameName
Last commit message
Last commit date
install
install
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
PROXMOX.md
PROXMOX.md
 
 
README.md
README.md
 
 
configuration.nix
configuration.nix
 
 
setup.sh
setup.sh
 
 

Repository files navigation

Links

Awesome Nix

Nix Package Search

NixLang Wiki

https://nix.dev/

Nix Starter Config

NixOS & Flakes Book

Create Proxmox VM

copy and paste the following into a proxmox terminal and run it:

URL="https://channels.nixos.org/nixos-23.11/latest-nixos-minimal-x86_64-linux.iso"
FILENAME="${URL##*/}"
LOCAL_IMAGE=/var/lib/vz/template/iso/$FILENAME
if [[ ! -f $LOCAL_IMAGE ]]; then 
   echo "downloading nixos iso..."
   curl -s $URL > $LOCAL_IMAGE
fi

if [[ $(qm list | grep -v grep | grep -ci ${VM_ID:-8000}) > 0 ]]; then
  qm stop ${VM_ID:-8000} --skiplock && qm destroy ${VM_ID:-8000} --destroy-unreferenced-disks --purge
fi
qm create ${VM_ID:-8000} --name nixos-23.11-template --memory 2048 --cores 4 --cpu cputype=host
qm set ${VM_ID:-8000} --agent 1 --machine q35 --ostype l26 --onboot 1 --scsihw virtio-scsi-pci 
qm set ${VM_ID:-8000} --net0 virtio,bridge=vmbr0 --ipconfig0 ip=dhcp
# media=cdrom is SUPER important to boot order, DO NOT remove it or your life will be pain!
qm set ${VM_ID:-8000} --scsi0 ${VM_STORAGE:-local-lvm}:32 --ide2 local:iso/$FILENAME,media=cdrom
qm set ${VM_ID:-8000} --bios ovmf --boot order='scsi0;ide2' --efidisk0 ${VM_STORAGE:-local-lvm}:0,pre-enrolled-keys=0,efitype=4m,size=528K 
qm start ${VM_ID:-8000}

Go to the VM console

Run the following two commands in the VM console (you'll have to type them in, since you can't copy and paste in the console)

# install curl

nix-shell -p curl

# https://t.ly/_c10E redirects to https://raw.githubusercontent.com/ilude/nix/main/setup.sh
# download file and save as setup

curl -Ls https://t.ly/_c10E > setup && bash setup
  • You will be prompted to provide a password for the default user 'anvil'.
  • Followed by two prompts to set the root password.
  • Nix will then build the system and you will be prompted to reboot.

After reboot

# edit configuration as you like
sudo nano /etc/nixos/configuration.nix

# apply configuration changes
sudo nixos-rebuild switch

About

Setup a NixOS VM on Proxmox

Topics

nixnixosproxmoxproxmox-ve

Resources

Readme
GPL-3.0 license
Activity

Stars

11 stars

Watchers

2 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.