This repository contains my nix-darwin configuration for macOS (shu) and multiple NixOS hosts.
This repository drew significant inspiration from the outstanding work done by Ryan Yin. The following repositories were referenced:
.
├── flakes/ # language/tool flakes
├── hosts/ # per-host configurations
├── lib/ # helper functions)
├── modules/ # shared module library
│ ├── README.md
│ ├── home-manager/ # reusable home-manager modules
│ │ ├── core/
│ │ ├── darwin/
│ │ └── linux/
│ └── nix-modules/ # reusable NixOS / nix-darwin modules
│ ├── core/
│ ├── darwin/
│ └── linux/
├── outputs/ # flake outputs grouped by system/architecture
│ ├── aarch64-linux/
│ │ ├── src/ # aarch64-linux host entries
│ │ └── default.nix
│ ├── aarch64-darwin/
│ │ ├── src/ # aarch64-darwin host entries
│ │ └── default.nix
│ ├── x86_64-linux/
│ │ ├── src/ # x86_64-linux host entries
│ │ └── default.nix
│ └── default.nix # merges architecture-specific outputs
├── vars/ # shared variables
├── flake.nix # main entry point
├── flake.lock # pinned inputs
├── README.md # repo overview
├── NIX-DARWIN_INSTALLATION.md # macOS install guide
├── NIXOS_INSTALLATION.md # nixOS install notes
├── Justfile # helper commands
└── result -> /nix/store/... # symlink to last build (if present)just init <hostname>wraps nixos-anywhere to bootstrap a remote machine. Pick the hostname (e.g.just init shupi) and it will run the appropriate flake output against the target over SSH.just deploy <hostname>applies changes via Colmena. Tags default to each hostname, soshupiaffects onlyshupi; group tags can be added in the per-host Colmena definition if needed.
vars/default.nix defines hostAddresses: a shared map of hostnames to IPs.
modules/nix-modules/core/ssh.nixconsumes this list to write/etc/hostsand generate SSH aliases everywhere.- Update
hostAddresseswhenever a new host is added, and both nix-darwin and NixOS configurations pick it up automatically.