This is my personal flake.
My system consists of an encrypted disk that restores itself to a pristine state on each boot. To return the root, I use a systemd service that runs after the base zpool is imported but before the root is actually mounted.
I create a number of wrapped packages. Those are portable, and I can use them on other Nix-installed systems without breaking the host's settings. Note that some configuration, like file paths, is excluded from wrapping because it depends on my config.
nix run github:sumelan/shirase#WRAPPED_PACKAGEThere is a script to create the zpool and partition. I know disko exists but prefer this method.
sh <(curl -L https://raw.githubusercontent.com/sumelan/shirase/main/partition.sh)Before running nixos-install, one task is required: writing the hardware
configuration for the target host. Filesystem mounts are already written in this
flake, but they lack info about hardware configs.
To generate a hardware config without filesystem info, run the command below.
nixos-generate-config --no-filesystems --show-hardware-configAfter writing the hardware config, you finally reach the install phase.
sudo nixos-install --no-root-password --flake "github:sumelan/shirase/main#HOST" --option tarball-ttl 0-
Took inspiration from these dotfiles: iynaix/dotfiles, Michael-C-Buckley/nixos, poz/niksos
-
Vimjoyer's YouTube
If you consider using NixOS, check out his YouTube channel!