[ARCHIVED]: config now moved to mother-of-all-infra
Below is only left for posterity.
- Install NixOS using the official ISO
- Generate an SSH key with
ssh-keygenand save the public key in github - Start a nix shell with git in it
nix --extra-experimental-features 'nix-command flakes' shell nixpkgs#git- Clone this repo
git clone git@github.com:snyssen/nixos-config.git && cd nixos-config- Generate a new hardware-configuration.nix file for your host and add it to staged changes
nixos-generate-config --dir hosts/[host]/
git add hosts/[host]/hardware-configuration.nix- Switch to the host configuration
sudo nixos-rebuild switch --flake .#[host]Tip
You can use the Nix Determinate installter to install nix on any Linux distro
nix shell nixpkgs#git-crypt --command git-crypt unlocksudo nixos-rebuild switch --flake .#gaming[WIP] Deployment with nixos-anywhere
Use live minimal image of nixos, then follow instructions at: https://nixos.org/manual/nixos/stable/#sec-installation-booting-networking
In particular you want:
- Change to keyboard layout:
sudo loadkeys /etc/kbd/keymaps/i386/azerty/be-latin1.map.gz - Connected to Wifi if needed:
nmtui - Set root password: sudo passwd
Most of what is needed is explained at the start of the terminal session. SSH should be enabled automatically and you should be able to login as root. Then from another computer:
echo "my-super-safe-password" > /tmp/secret.key
nix run github:nix-community/nixos-anywhere -- --flake .#gaming --target-host snyssen@192.168.1.108 --generate-hardware-config nixos-generate-config ./hosts/gaming/hardware-configuration.nix --disk-encryption-keys /tmp/secret.key /tmp/secret.key