Created
October 8, 2021 23:21
-
-
Save dysinger/5e1f421b39859d2642527bdf9f70cfba to your computer and use it in GitHub Desktop.
My /etc/nixos/configuration.nix with full disk encrypted ZFS and USB thumb EXT4 /boot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EFI/BOOT: | |
# export BOOT=/dev/disk/by-id/usb-SanDisk_Ultra_Fit_4C530001011030101042-0\:0 | |
# parted --script $BOOT -- \ | |
# mklabel gpt \ | |
# mkpart esp fat32 1MiB 512MiB \ | |
# mkpart primary 512MiB 100% \ | |
# set 1 boot on | |
# mkfs.vfat $BOOT-part1 | |
# ZFS: | |
# export ROOT=/dev/disk/by-id/nvme-WDC_PC_SN730_SDBQNTY-1T00-1001_2018JE446304 | |
# zpool create -f \ | |
# -o ashift=9 \ | |
# -O compression=on \ | |
# -O encryption=on \ | |
# -O keyformat=passphrase \ | |
# -O mountpoint=none \ | |
# -R /mnt \ | |
# laptop \ | |
# $ROOT | |
# zfs create -o mountpoint=none -o refreservation=1G laptop/reserved | |
# zfs create -o mountpoint=none laptop/local | |
# zfs create -o mountpoint=legacy laptop/local/nix | |
# zfs create -o mountpoint=none laptop/system | |
# zfs create -o mountpoint=legacy laptop/system/root | |
# zfs create -o mountpoint=legacy -o xattr=sa -o acltype=posixacl laptop/system/var | |
# zfs create -o mountpoint=none laptop/user | |
# zfs create -o mountpoint=legacy laptop/user/home | |
# zfs set com.sun:auto-snapshot=true laptop/user | |
# INSTALL: | |
# mount -t zfs laptop/system/root /mnt | |
# mkdir /mnt/{nix,var,home,boot} | |
# mount -t zfs laptop/local/nix /mnt/nix | |
# mount -t zfs laptop/system/var /mnt/var | |
# mount -t zfs laptop/user/home /mnt/home | |
# mount -t vfat $BOOT-part1 /mnt/boot | |
# nixos-generate-config --root /mnt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment