Dendritic setup
I'll be moving generic/reusable configurations into Dennix and dogfooding them in here.
My flake.nix
file serves mainly for listing dependencies and adding nix config and caches.
The entrypoint is default.nix
which simply uses vic/import-tree to load all ./modules/**/*.nix
flake-parts modules.
Hosts are flake exposed at osConfigurations.nix. Each host instance loads a modules.nixos.${hostname}
or modules.darwin.${hostname}
and I also have base modules for each type of host modules.nixos.wsl
, modules.nixos.nixos
and modules.darwin.darwin
. These can be found under the features directory. Each host particular configuration also mixins some other features as needed.
Most host include their respective (darwin/nixos) vic
user configuration module.
My home-managed features are under the vic directory and they
are mixed automatically under the a single modules.homeManager.vic
, flake exposed by vic/home.nix.
There's an action that builds each host independently pusing builds at vix cachix. so that evaluating later locally will just download those cached derivations.
TODO: Automate this on Bombadil USB (Issue #75)
# Edit your partitions. Mount /mnt/{boot,home,etc}
git clone https://github.com/vic/vix /mnt/home/vic/vix
# Make sure you update hosts/HOST/{filesystems, hardware-configuration}.nix
# To match the current hardware.
# Will be used during home-manager activation, to link .config files.
ln -sfn /home/vic/vix /mnt/home/vic/.flake
# Setup local sops keys via SSH Forwarded SOPS_SERVER.
# You will be prompted for a Password.
nix run path:/mnt/home/vic/vix#vic-sops-get -- \
--keyservice tcp://SOPS_SERVER:5000 -f SSH_KEY --setup - \
>> /mnt/home/vic/.config/sops/age/keys.txt
# Finally install nixos
nixos-install --root /mnt --flake /mnt/home/vic/vix#HOST
# You will be prompted for a root password by the installer
# Dont forget to choot and setup password for users.
TODO: Generate WSL2 tarball (Issue #83)
# * import and boot from NixOS-WSL
# * clone, link-flake and setup-sops-keys (see NixOS install)
# apply configuration
nix run path:~/vix#os-rebuild -- HOST switch
# on a windows terminal:
> wsl.exe --terminate NixOS
> wsl.exe -d NixOS
You need nix installed.
We recommend Lix Installer, and
using install macos --volume-label
if you are using multiple MacOS installations.
# * install nix
# * clone, link-flake and setup-sops-keys (see NixOS install)
# apply configuration
nix run path:~/vix#os-rebuild -- HOST switch
nix run path:~/vix#os-rebuild -- HOST switch
nix develop .#nixos -c vic-sops-rotate
Defined at /modules/flake/osConfigurations.nix
.
USB Bootable
CI: ubuntu-latest
Build: nix build .#.nixosConfigurations.installer.config.system.build.isoImage
Users: vic
Host: MacMini M4
CI: macos-latest
Build: darwin-rebuild --flake .#varda build
Users: vic
Host: MacBook Pro Late-2011
CI: macos-13
Build: darwin-rebuild --flake .#yavanna build
Users: vic
Host: MacBook Pro Late-2011
CI: ubuntu-latest
Build: nixos-rebuild --flake .#niena build
Users: vic
Host: ASUS ROG Tower.
CI: ubuntu-latest
Build: nixos-rebuild --flake .#mordor build
Users: vic
Host: ASUS ROG Tower.
CI: ubuntu-latest
Build: nixos-rebuild --flake .#annatar build
Users: vic
Host: Laptop Lenovo
CI: ubuntu-latest
Build: nixos-rebuild --flake .#nargun build
Users: vic
Host: Laptop HP
CI: ubuntu-latest
Build: nixos-rebuild --flake .#smaug build
Users: runner (vic)
Host: GH Action Runner (Upterm + VSCode Remote)
CI: ubuntu-24.04-arm
Build: home-manager --flake .#runner@bill build
Users: runner (vic)
Host: GH Action Runner (Upterm + VSCode Remote)
CI: macos-latest
Build: home-manager --flake .#runner@bert build
Users: runner (vic)
Host: GH Action Runner (Upterm + VSCode Remote)
CI: ubuntu-latest
Build: home-manager --flake .#runner@tom build