nixos-config/modules
Charlotte Van Petegem b2a73d151c
Update accentor
2021-05-07 11:07:00 +02:00
..
accentor Update accentor 2021-05-07 11:07:00 +02:00
default Basic configuration for new servers and start modularizing config 2020-12-01 19:23:28 +01:00
emacs Re-organize emacs main settings 2021-05-06 14:09:35 +02:00
ssh 🔒 Secret 🔒 2021-03-15 14:24:28 +01:00
sshd 🔒 Secret 🔒 2020-12-27 19:10:33 +01:00
tetris Manage tetris with NixOS 2021-04-05 16:23:30 +02:00
accentor.nix Update accentor 2021-05-07 11:07:00 +02:00
bluetooth.nix Rework common profile into module system 2020-12-05 13:44:29 +01:00
default.nix Manage tetris with NixOS 2021-04-05 16:23:30 +02:00
docker.nix Basic configuration for new servers and start modularizing config 2020-12-01 19:23:28 +01:00
eid.nix Rework common profile into module system 2020-12-05 13:44:29 +01:00
emacs.nix Emacs changes 2021-05-01 01:00:04 +02:00
git.nix Basic configuration for new servers and start modularizing config 2020-12-01 19:23:28 +01:00
global-mailer.nix Rework common profile into module system 2020-12-05 13:44:29 +01:00
minecraft.nix Minecraft 2021-03-08 15:01:46 +01:00
nextcloud.nix Make sure to only setup nextcloud after database is started 2021-04-07 10:29:59 +02:00
nginx.nix Basic configuration for new servers and start modularizing config 2020-12-01 19:23:28 +01:00
nix.nix Use flake-utils-plus 2021-03-24 11:07:32 +01:00
ovh.nix Basic configuration for new servers and start modularizing config 2020-12-01 19:23:28 +01:00
README.md Add some instructions on how to set-up ZFS for use with the custom module 2020-05-23 10:46:18 +02:00
smartd.nix Rework common profile into module system 2020-12-05 13:44:29 +01:00
ssh.nix SSH changes 2021-02-04 10:20:18 +01:00
sshd.nix Basic configuration for new servers and start modularizing config 2020-12-01 19:23:28 +01:00
syncthing-server.nix Basic configuration for new servers and start modularizing config 2020-12-01 19:23:28 +01:00
teeworlds.nix Add some modules for game hosting 2020-12-24 10:41:40 +01:00
tetris.nix Manage tetris with NixOS 2021-04-05 16:23:30 +02:00
tmux.nix Get rid of neomutt and neovim 2021-03-20 21:29:18 +01:00
zeroad.nix Update dependencies 2021-03-20 14:26:55 +01:00
zfs.nix Fix rolling back to blank root snapshot on servers 2020-12-11 10:24:07 +01:00
zotero.nix Zotero 2021-02-22 15:13:10 +01:00
zsh.nix First emacs configuration 2021-03-09 00:47:41 +01:00

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.