Prerequisites:
- Disable Secure Boot
- Download NixOS ISO & mount on machine
- Delete some stuff:
sudo su && rm -rf /etc/nixos /etc/NIXOS && mkdir -p /etc/nixos
- Clone this repo to the machine:
nix --experimental-features "nix-command flakes" run nixpkgs#git -- clone https://github.com/keenanweaver/nix-config.git /etc/nixos/.
- Partition the disks:
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /etc/nixos/hosts/desktop/disko.nix
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /etc/nixos/hosts/laptop/disko.nix
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /etc/nixos/hosts/pi/disko.nix
nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /etc/nixos/hosts/vm/disko.nix
- Verify hardware-configuration.nix disk IDs, add to repo hardware-configuration.nix:
nixos-generate-config --root /mnt
- If necessary, comment out nix-nonfree flake/import.
- Enter nix-shell:
nix-shell --experimental-features "nix-command flakes" -p git
- Set up Secure Boot keys:
- Verify ESP is mounted at /boot:
bootctl status
- Create keys:
sudo sbctl create-keys
- Verify ESP is mounted at /boot:
- Install:
nixos-install --flake .#nixos-desktop
nixos-install --flake .#nixos-laptop
nixos-install --flake .#nixos-pi
nixos-install --flake .#nixos-unraid
- Reboot:
reboot
- Finish Secure Boot setup:
- Rebuild your system and check the sbctl verify output:
sudo sbctl verify
- Reboot to BIOS and enable Secure Boot. You may need to erase all Secure Boot settings.
- Reboot and enroll the keys:
sudo sbctl enroll-keys --microsoft
- Reboot and verify Secure Boot is activated:
bootctl status
- Rebuild your system and check the sbctl verify output:
- Clone this repo to the machine:
nix run nixpkgs#git -- clone https://github.com/keenanweaver/nix-config.git /etc/nixos/.
- Update flake (optional):
sudo nix flake update /etc/nixos
- Apply configuration:
sudo nixos-rebuild switch --impure --upgrade --flake /etc/nixos/#nixos-desktop
sudo nixos-rebuild switch --impure --upgrade --flake /etc/nixos/#nixos-laptop
sudo nixos-rebuild switch --impure --upgrade --flake /etc/nixos/#nixos-pi
sudo nixos-rebuild switch --impure --upgrade --flake /etc/nixos/#nixos-unraid
- Copy private SSH keys & secrets to ~/.ssh and ~/.config/sops/age respectively.
- Set up ~/.config/nix.conf with private GitHub token for nix-nonfree repo:
access-tokens = github.com=ghp_blahblahblah
- Uncomment out nix-nonfree flake input (optional)
- Initialize ssh-agent:
ssh-add ~/.ssh/id_ed25519 && ssh-add -l
- Run
nixos-rebuild switch
Run bootstrap-baremetal.sh
or
- Set up distrobox containers:
distrobox create assemble
distrobox enter bazzite-arch-exodos -- bash -l -c "bootstrap-distrobox"
distrobox enter bazzite-arch-gaming -- bash -l -c "bootstrap-distrobox"
- Set up games. See GAMES.md
- Log into GOG and Internet Archive
lgogdownloader
ia configure