- Get the NixOS
- Copy the Installer to a USB Stick:
sudo cp /path/to/iso /dev/to/disk
- Boot on the ISO
- Clone this repository
git clone https://github.com/jocelynthode/nixos-config
cd nixos-config
- Run bootstrap.sh
nix develop
# This will wipe the disk and create a bootloader
./bootstrap.sh [--encrypt-root] --hostname=<hostname> --disk=/dev/to/disk
-
Setup new age key if needed
-
Rekey your secrets
sops updatekeys secrets/common/secrets.yaml
sops updatekeys secrets/servetek/secrets.yaml
- Bootstrap system
nixos-install --no-root-password --flake ".#<hostname>"
umount -R /mnt
# if needed
cryptsetup close <hostname>
- Reboot
To rebuild after changes have made it to the repo use:
sudo nixos-rebuild switch --flake github:jocelynthode/nixos-config
nix develop
# Then create file
sops hosts/common/secrets.yaml
nix develop
cat /persist/etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'
sops hosts/common/secrets.yaml
To Build the custom iso run the following commands:
nix build .#nixosConfigurations.iso.config.system.build.isoImage
dd if=result/iso/*.iso of=/dev/sdX status=progress
sync