Figure out how to host NixOS LXC containers on buskerud #145

Closed
opened 2024-08-26 17:15:07 +02:00 by oysteikt · 3 comments
Owner

This should be easy in theory, but last time I tried following the guide it went horribly wrong. I don't remember the exact errors, but there are probably some extra steps involved. It would be nice if we could document exactly how it's done on the wiki.

This should be easy in theory, but last time I tried following the guide it went horribly wrong. I don't remember the exact errors, but there are probably some extra steps involved. It would be nice if we could document exactly how it's done on the wiki.
oysteikt added the
servers n' hardware
bug
documentation
nixos
labels 2024-08-26 17:15:08 +02:00
oysteikt added this to the Kanban project 2024-08-26 17:15:08 +02:00
Owner

image

![image](/attachments/0f6288aa-2be5-4423-83c9-7bf9630aba0a)
612 KiB
Author
Owner

Only works via cli apparently: https://mtlynch.io/notes/nixos-proxmox/

Only works via cli apparently: https://mtlynch.io/notes/nixos-proxmox/
Author
Owner
# Where the template file is located
TEMPLATE_STORAGE='local'
# Name of the template file downloaded from Hydra.
TEMPLATE_FILE='nixos-24.11-2024-12-08-lxdContainerImage.x86_64-linux.tar.xz'
# Name to assign to new NixOS container.
CONTAINER_HOSTNAME='ustetind'
# Which storage location to place the new NixOS container.
CONTAINER_STORAGE='tank'
# How much RAM to assign the new container.
CONTAINER_RAM_IN_MB='8196'
# How much disk space to assign the new container.
CONTAINER_DISK_SIZE_IN_GB='200'

pct create "$(pvesh get /cluster/nextid)" \
  --arch amd64 \
  "${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE_FILE}" \
  --ostype unmanaged \
  --description nixos \
  --hostname "${CONTAINER_HOSTNAME}" \
  --net0 name=eth0,bridge=vmbr0,ip=dhcp,firewall=1 \
  --storage "${CONTAINER_STORAGE}" \
  --memory "${CONTAINER_RAM_IN_MB}" \
  --rootfs ${CONTAINER_STORAGE}:${CONTAINER_DISK_SIZE_IN_GB} \
  --unprivileged 1 \
  --features nesting=1 \
  --cmode console \
  --onboot 1 \
  --start 1
```bash # Where the template file is located TEMPLATE_STORAGE='local' # Name of the template file downloaded from Hydra. TEMPLATE_FILE='nixos-24.11-2024-12-08-lxdContainerImage.x86_64-linux.tar.xz' # Name to assign to new NixOS container. CONTAINER_HOSTNAME='ustetind' # Which storage location to place the new NixOS container. CONTAINER_STORAGE='tank' # How much RAM to assign the new container. CONTAINER_RAM_IN_MB='8196' # How much disk space to assign the new container. CONTAINER_DISK_SIZE_IN_GB='200' pct create "$(pvesh get /cluster/nextid)" \ --arch amd64 \ "${TEMPLATE_STORAGE}:vztmpl/${TEMPLATE_FILE}" \ --ostype unmanaged \ --description nixos \ --hostname "${CONTAINER_HOSTNAME}" \ --net0 name=eth0,bridge=vmbr0,ip=dhcp,firewall=1 \ --storage "${CONTAINER_STORAGE}" \ --memory "${CONTAINER_RAM_IN_MB}" \ --rootfs ${CONTAINER_STORAGE}:${CONTAINER_DISK_SIZE_IN_GB} \ --unprivileged 1 \ --features nesting=1 \ --cmode console \ --onboot 1 \ --start 1 ```
Sign in to join this conversation.
No description provided.