Skip to content

Instantly share code, notes, and snippets.

@turlando
Created April 29, 2020 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save turlando/a9d5a6a274983b9039fab30d24542fab to your computer and use it in GitHub Desktop.
Save turlando/a9d5a6a274983b9039fab30d24542fab to your computer and use it in GitHub Desktop.
timedatectl set-ntp true
sgdisk --zap-all /dev/sda # system drive 1
sgdisk --zap-all /dev/sdb # system drive 2
sgdisk --zap-all /dev/sdc # boot drive 1
sgdisk --zap-all /dev/sdd # boot drive 2
parted --script /dev/sdc \
mklabel gpt \
mkpart grub 1MiB 2MiB \
mkpart boot ext4 2MiB 2GiB \
set 1 bios_grub on \
set 2 raid on \
set 2 boot on
parted --script /dev/sdd \
mklabel gpt \
mkpart grub 1MiB 2MiB \
mkpart boot ext4 2MiB 2GiB \
set 1 bios_grub on \
set 2 raid on \
set 2 boot on
mdadm --create \
--homehost=any --level=1 \
--raid-devices=2 \
/dev/md/boot \
/dev/sdc2 /dev/sdd2
mkfs.ext4 -L boot /dev/md/boot
zpool create \
-m none \
-o ashift=12 \
-o altroot=/mnt \
-O canmount=off \
-O checksum=fletcher4 \
-O compression=lz4 \
-O xattr=sa \
-O normalization=formD \
-O atime=off \
system \
/dev/disk/by-id/ata-VBOX_HARDDISK_VB10d38041-dcd83449 \
/dev/disk/by-id/ata-VBOX_HARDDISK_VBf5f6d66e-b8ecc303
zfs create \
-o mountpoint=legacy \
system/nix
zfs create \
-o acltype=posixacl \
-o encryption=aes-256-gcm -o keyformat=passphrase -o keylocation=prompt \
-o mountpoint=legacy \
system/local
zfs create \
-o encryption=aes-256-gcm -o keyformat=passphrase -o keylocation=prompt \
-o mountpoint=legacy \
system/home
mount -t zfs system/local /mnt
mkdir /mnt/boot
mount -t ext4 /dev/md/boot /mnt/boot
mkdir /mnt/nix
mount -t zfs system/nix /mnt/nix
mkdir /mnt/home
mount -t zfs system/home /mnt/home
nixos-generate-config --root /mnt
##################################################
# boot.loader.grub.devices = [ "/dev/sdc" "/dev/sdd" ];
# boot.supportedFilesystems = [ "zfs" ];
# networking.hostId = "deadbeef";
##################################################
nixos-install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment