No description
  • Nix 94.7%
  • Emacs Lisp 4%
  • Shell 1.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Renovate Bot 6f548af469
All checks were successful
Attic / build (pull_request) Successful in 1m40s
Attic / build (push) Successful in 44s
Lock file maintenance
2026-10-15 22:01:55 +00:00
.forgejo/workflows Replace custom update workflow with renovate automerge lockFileMaintenance 2026-10-07 09:48:37 +02:00
machines Make /var/lib/nixos a less-aggressively saved dataset on kholinar 2026-10-15 17:37:30 +02:00
modules Switch to forgejo-runner service config 2026-10-15 15:08:37 +02:00
patches Revert "Add patch to only pass GIT_PROTOCOL to forgejo user" 2026-10-10 21:51:11 +02:00
secrets Switch to forgejo-runner service config 2026-10-15 15:08:37 +02:00
shells Switch to nixfmt for formatting nix files 2026-08-29 16:11:16 +02:00
.gitignore Add .envrc to .gitignore 2026-08-29 16:59:48 +02:00
agenix-rules.nix Switch to forgejo-runner service config 2026-10-15 15:08:37 +02:00
build_and_cache_all.sh Use --raw instead --json with an extra sed 2026-07-14 21:55:04 +02:00
flake.lock Lock file maintenance 2026-10-15 22:01:55 +00:00
flake.nix Fix formatting 2026-10-14 14:06:08 +02:00
license.md Update license.md 2020-09-27 14:41:25 +02:00
README.md Move foreign dev shells to flake outputs 2022-04-30 16:25:31 +02:00
remote.sh Use --raw instead --json with an extra sed 2026-07-14 21:55:04 +02:00
renovate.json Replace custom update workflow with renovate automerge lockFileMaintenance 2026-10-07 09:48:37 +02:00
update.sh git pull instead of nix flake update since actions does the update for me 2022-01-14 09:43:57 +01:00

NixOS config

Secrets

Secrets should never be world-readable, even to users who are logged in to one of the hosts managed by this configuration. These are generally managed by agenix, allowing them to still be put in the nix store.

Setting up a new dev environment

  • Add a shell to the devShells output in flake.nix.

  • Execute use_flake /path/to/repo#name-of-shell > .envrc to initialize the .envrc file.

  • Execute direnv allow to load the .envrc file which in turn loads your environment.

Setting up ZFS

  1. Create three partitions:

    • Boot
    • Swap
    • ZFS

    For example:

    sgdisk -n 0:0:+512MiB -t 0:EF00 -c 0:boot $DISK
    sgdisk -n 0:0:+32GiB -t 0:8200 -c 0:swap $DISK
    sgdisk -n 0:0:0 -t 0:BF01 -c 0:ZFS $DISK
    
  2. Configure swap and boot as usual.

  3. Create ZPool:

    zpool create -O mountpoint=none -O encryption=aes-256-gcm -O keyformat=passphrase rpool $ZFS_PART
    

    Leave out -O encryption=aes-256-gcm -O keyformat=passphrase if you don't want to fully encrypt the ZFS partition.

  4. Create datasets:

    zfs create -o mountpoint=legacy rpool/local/root
    zfs snapshot rpool/local/root@blank
    zfs create -o mountpoint=legacy rpool/local/nix
    zfs set compression=lz4 rpool/local/nix
    zfs create -o mountpoint=legacy rpool/local/cache
    zfs set compression=lz4 rpool/local/cache
    zfs create -o mountpoint=legacy rpool/safe/data
    zfs set compression=lz4 rpool/local/data
    
  5. Mount datasets:

    mount -t zfs rpool/local/root /mnt
    mkdir /mnt/nix
    mount -t zfs rpool/local/nix /mnt/nix
    mkdir /mnt/boot
    mount $BOOT_PART /mnt/boot
    mkdir /mnt/cache
    mount -t zfs rpool/local/cache /mnt/cache
    mkdir /mnt/data
    mount -t zfs rpool/safe/data /mnt/data
    
  6. Configure Host ID

    Set networking.hostid in the nixos config to head -c 8 /etc/machine-id.