My fleet of Nix-managed devices.
Naming conventions and logos in this repository are mainly derived from Genshin Impact by miHoYo/HoYoverse.
Start developing with your own flavor of shell:
nix develop -c $SHELL
Don't have nix flake support? Try this instead:
nix-shell
Format the nix code:
nix fmt
To inspect evaluated values or do experiments, you may run REPL using:
nix run .#repl
This breif guide only covers NixOS hosts (excluding LXC containers).
First boot into NixOS Live CD and clone this repository.
This is required for hosts having disks.nix
file declaring disk partition layout. This is made possible with disko.
Navigate to host folder containing disk.nix
and run following command:
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko ./disks.nix
After running disko, the newly created partitions should be already mounted at /mnt
.
For hosts with impermanence enabled, run following command:
sudo mkdir /mnt/nix/persist
Run following command to generate new ssh key pair:
sudo mkdir -p /mnt/nix/persist/etc/ssh/
sudo ssh-keygen -t ed25519 -f /mnt/nix/persist/etc/ssh/ssh_host_ed25519_key -C ""
Add generated public key to /secrets/pubkeys.nix
, then navigate to /secrets
and run following command to rekey all credentials:
agenix -r
Before installation, please note:
- Lanzeboot requires generating keys with
sudo sbctl create-keys
before-hand. You may also temporarily disable Secure Boot and configure it after first boot.
Run following command under repo root path:
sudo nixos-install --flake .#hostname
You can now reboot from Live CD and boot into your newly installed device.