I occasionally need to reinstall my workspace and this process needs to be repeatable. Using Nix is the most repeatable way I have found so far.
This repository is organized over three main topics:
-
obtaining an install media which fits my needs
-
having all my hosts configurations under version control
-
having my user environment under version control
The installation media is designed to install NixOS on standard x86_64 laptops.
The whole process has its own specific documentation.
Most of the install process is detailed in the installation media documentation.
Nevertheless some additional tasks are needed:
-
the
del
user password ispassword
by default and need to be changed on the first boot -
the host ssh public key needs to be added to this repository:
-
on a platform allowed to modify the repository, retrieve the file
/etc/ssh/ssh_host_ed25519_key.pub
from the new host -
compute the host
age
key from the ssh public key withssh-to-age
:ssh-to-age -i <path/to/ssh_host_ed25519_key.pub>
-
add the
age
key to the repository SOPS keys -
update the keys of the SOPS managed secrets file:
sops updatekeys <repository root>/hosts/_/sops.yaml
-
commit and push these modifications
-
-
pass on the modifications to the new host and initialize the user environment:
-
sudo nixos-rebuild switch --flake github:gautaz/phoenix
-
home-manager switch --flake github:gautaz/phoenix
-
passage-bootstrap
-
Hosts configurations are flake based and can be installed with both nixos-install --flake
(from the installation media environment) and nixos-rebuild switch --flake
.
The available hosts are:
I rely on the standalone installation of Home Manager to deploy my user environment. The reason why I do not use Home Manager as a NixOS module is because I want to be able to use it even when I cannot choose NixOS as my operating system.
As home-manager
also supports a --flake
option to install flake based user environments, this repository’s flake provides a home environment for my main and only account (del
).