No description
Find a file
2022-01-23 18:48:13 +00:00
.github Bump stefanzweifel/git-auto-commit-action from 4.13.0 to 4.13.1 2022-01-14 08:34:48 +01:00
machines Remove tryhackme vpn 2022-01-15 13:00:43 +01:00
modules Update accentor 2022-01-22 13:31:44 +01:00
packages kotlin-language-server: 1.1.2 -> 1.2.0 2021-12-08 13:22:22 +01:00
patches Add sway 1.7rc3 patch 2022-01-22 08:50:30 +01:00
secrets Remove tryhackme vpn 2022-01-15 13:00:43 +01:00
shells Update accentor 2022-01-22 13:31:44 +01:00
flake.lock Update dependencies 2022-01-23 18:48:13 +00:00
flake.nix Switch back to firefox 2022-01-21 13:30:23 +01:00
license.md Update license.md 2020-09-27 14:41:25 +02:00
README.md Remove all git-crypt 2021-09-16 15:24:35 +02:00
remote.sh Build and push to cachix 2022-01-11 21:44:13 +01:00
secrets.nix Remove tryhackme vpn 2022-01-15 13:00:43 +01: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

  • Create a new *.nix file in the shells directory that describes the environment (this is the hard part).

  • Execute use_nix > .envrc to initialize the .envrc file.

  • Execute ln -s /path/to/correct/file.nix shell.nix.

  • 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.