Work-in-progress NixOS Server Infrastructure
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Luna e6653530bf
Some checks failed
Build Nix / Checks Nix formatting (push) Failing after 25s
Build Nix / Checks Nix flake (push) Failing after 46s
Build Nix / Build NixOS host "andromeda" (push) Has been skipped
Build Nix / Build NixOS host "milkyway" (push) Has been skipped
Build Nix / Build NixOS host "quasar" (push) Has been skipped
Build Nix / Build NixOS host "stardust" (push) Has been skipped
Build Nix / Build NixOS host "supernova" (push) Has been skipped
chore: Update site to v2.0.2b
2026-10-23 00:16:52 -04:00
.forgejo/workflows chore: Add NAS host to CI workflows 2025-07-27 12:14:47 -04:00
.zed fix: Fixes SSO config errors 2025-07-01 16:55:07 -04:00
data chore: First commit 2025-06-30 22:05:17 -04:00
modules chore: Update site to v2.0.2b 2026-10-23 00:16:52 -04:00
secrets@232621c2d0 fix: Remove extra hosts stuff for now 2026-10-16 20:44:54 -04:00
.gitignore fix: Fixes macOS metadata files not being ignored 2026-06-08 14:04:16 -07:00
.gitmodules chore: First commit 2025-06-30 22:05:17 -04:00
.prettierignore fix: Fixes SSO config errors 2025-07-01 16:55:07 -04:00
.sops.yaml chore: First commit 2025-06-30 22:05:17 -04:00
flake.lock flake.lock: Update 2026-10-16 20:37:59 -04:00
flake.nix fix: Fixes Linux building issues 2026-06-14 17:10:46 -04:00
LICENSE chore: First commit 2025-06-30 22:05:17 -04:00
overlays.nix chore: Restructure nix configuration, in preparation for macOS 2026-05-28 14:19:04 -04:00
post-modification.sh chore: First commit 2025-06-30 22:05:17 -04:00
README.md chore: Install iBus 2026-06-16 23:22:00 -04:00

Luna's NixOS Home Infrastructure

Work-in-progress NixOS Server Infrastructure based on valerie's NixOS setup.

Setup

Setting up Sops

TODO.

Bootstrapping a New Device

  1. First, boot the NixOS live environment (minimal ISO is recommended).

  2. Then, get the harddrive ID using lsblk or fdisk -l:

    sudo fdisk -l
    ls -lah /dev/disk/by-id | grep -i <drive disk ID ie. sda>
    

    Example output:

    [nix-shell:~]$ sudo fdisk -l
    Disk /dev/loop0: 1.14 GiB, 1221455872 bytes, 2385656 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/sda: 256 GiB, 274877906944 bytes, 536870912 sectors
    Disk model: QEMU HARDDISK
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    [nix-shell:~]$ ls -lah /dev/disk/by-id | grep -i sda
    lrwxrwxrwx 1 root root   9 May  5 13:20 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0 -> ../../sda
    
    [nix-shell:~]$ # disk path: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0
    
  3. Manually create a host configuration by modifying/duplicating hosts/<target_host_to_base_off_of> to hosts/<new_host_name>. Be sure to modify the hostname in hosts/<new_host_name>/configuration.nix.

  4. Add the host to flake.nix.

  5. Modify the disko configuration for our host to use the correct disk ID that we found earlier.

  6. Make any other additional modifications if needed.

Installing the Configuration

  1. Copy/clone the configuration over to the host to install and cd into it.
  2. Copy the sops key data to the host you are installing on (sops key.txt and ssh_host_ed25519_key to /var/lib/sops-nix/)
  3. Run sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko/latest -- --mode destroy,format,mount -f "$PWD#hostname" to prepare the disk, replacing hostname with the host you want to install (ex. andromeda).
  4. Before installing, prepare sops inside the mounted filesystem: sudo mkdir -p /mnt/persist/var/lib/sops-nix/; sudo cp -r /var/lib/sops-nix/ /mnt/persist/var/lib/; sudo chmod -R 755 /mnt/persist/var/lib/sops-nix/
  5. Run sudo nixos-install --flake "$PWD#hostname" to install the OS, replacing hostname with the host you want to install (ex. andromeda).
  6. Copy the current configuration into /etc/nixos: sudo cp -r $PWD/. /mnt/persist/etc/nixos