Declarative and reproducible configuration for my systems, powered by NixOS ❄️.
-
Build the latest ISO image through Nix:
$ nix build github:Frontear/dotfiles#ISO-3DT4F02.config.system.build.isoImageThen, copy it to a USB drive and boot from it.
-
Create the expected partition table using the following script:
#!/usr/bin/env bash # NOTE: run this as root. # Declare the target disk ahead-of-time export DISK="/dev/<DEVICE>" # e.g. /dev/sda, /dev/nvme0n1, ... # Wipe all existing partitions from the drive sfdisk --delete "$DISK" # Use the GPT partition layout sfdisk "$DISK" <<< "label: gpt" # Create the EFI partition sfdisk --append "$DISK" <<< ",1G,U" # Create the Nix partition sfdisk --append "$DISK" <<< ",,L" # Label the newly created partitions sfdisk --part-label "$DISK" 1 "boot" sfdisk --part-label "$DISK" 2 "nix"
-
Format the created partitions with the expected fs types:
$ wipefs --all /dev/disk/by-partlabel/boot $ wipefs --all /dev/disk/by-partlabel/nix $ mkfs.fat -F 32 /dev/disk/by-partlabel/boot $ mkfs.btrfs -n 64k /dev/disk/by-partlabel/nix
-
Mount them into
/mntfor the installer:$ mount -t tmpfs -o mode=0755,noatime,noswap,size=1G tmpfs /mnt --mkdir $ mount -o dmask=0022,fmask=0022,noatime /dev/disk/by-partlabel/boot /mnt/boot --mkdir $ mount -o compress=zstd:15,noatime /dev/disk/by-partlabel/nix /mnt/nix --mkdir
-
Install configuration to target root in
/mnt:$ nixos-install --flake "github:Frontear/dotfiles#<HOST>" --no-channel-copy --no-root-password