My nix-darwin and NixOS config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: update README

+56 -25
+56 -25
README.md
··· 1 1 # Nix Configuration 2 2 3 - v0.3.1 3 + v0.4.0 4 4 5 - Personal NixOS and nix-darwin configurations for managing multiple machines with a unified, centralized setup. 5 + Personal NixOS and nix-darwin configurations for managing multiple 6 + machines with a unified, centralized setup. 6 7 7 - > **Note:** This is a personal configuration repository. While you're welcome to use it as reference, it's specifically tailored to my needs and setup. 8 - 9 - > **๐ŸŽฏ Quick Start for Forkers:** Edit `modules/options.nix` to customise everything โ€” username, email, git settings, desktop theme, packages, and more. Per-host overrides go in `hosts/<hostname>/default.nix`. 8 + > **Note:** This is a personal configuration repository. While 9 + > you're welcome to use it as reference, it's specifically tailored 10 + > to my needs and setup. 11 + > 12 + > **๐ŸŽฏ Quick Start for Forkers:** Edit `modules/options.nix` to 13 + > customise everything โ€” username, email, git settings, desktop 14 + > theme, packages, and more. Per-host overrides go in 15 + > `hosts/<hostname>/default.nix`. 10 16 11 17 ## Key Features 12 18 13 - โœจ **Centralized Configuration** - All option defaults in `modules/options.nix` (single source of truth) 19 + โœจ **Centralized Configuration** - All option defaults in 20 + `modules/options.nix` (single source of truth) 14 21 ๐Ÿ”„ **DRY Principles** - Zero duplication; the NixOS module system handles everything 15 22 ๐ŸŽฏ **Easy Customization** - Change any default in one file, applies everywhere 16 23 ๐Ÿ“ฆ **Multi-System** - Unified config for NixOS and macOS ··· 27 34 ### Linux (NixOS) - SECONDARY 28 35 29 36 - **laptop** - Dell Inspiron 3501 with KDE Plasma 6 โ€” Secondary workstation 30 - - **server** - Minimal headless server โ€” Bluesky PDS, Forgejo, Cloudflare tunnel + hardened security 37 + - **server** - Minimal headless server โ€” Bluesky PDS, Forgejo, 38 + Nextcloud, Cloudflare tunnel + hardened security 31 39 32 40 ## Repository Structure 33 41 34 - ``` 42 + ```text 35 43 . 36 44 โ”œโ”€โ”€ flake.nix # Main flake โ€” defines all hosts 37 45 โ”œโ”€โ”€ flake.lock # Locked dependency versions ··· 51 59 โ”‚ โ”œโ”€โ”€ users.nix # User account configuration 52 60 โ”‚ โ”œโ”€โ”€ caddy.nix # Caddy web server 53 61 โ”‚ โ”œโ”€โ”€ pds.nix # Bluesky ATProto PDS 62 + โ”‚ โ”œโ”€โ”€ pds-landing/ # PDS landing page assets 54 63 โ”‚ โ”œโ”€โ”€ forgejo.nix # Forgejo git forge 64 + โ”‚ โ”œโ”€โ”€ nextcloud.nix # Nextcloud instance 55 65 โ”‚ โ”œโ”€โ”€ cloudflare-tunnel.nix # Cloudflare tunnel (outbound-only) 56 - โ”‚ โ”œโ”€โ”€ cockpit.nix # Cockpit web console 57 66 โ”‚ โ”œโ”€โ”€ ssh-keys.nix # Public key registry for all hosts 58 67 โ”‚ โ”œโ”€โ”€ server/ # Headless server sub-modules 59 68 โ”‚ โ”‚ โ”œโ”€โ”€ firewall.nix ··· 76 85 โ”‚ 77 86 โ”œโ”€โ”€ home/ # Home Manager (unified across all hosts) 78 87 โ”‚ โ”œโ”€โ”€ default.nix # Main entry point 79 - โ”‚ โ””โ”€โ”€ programs/ # Per-program config (git, zsh, ssh, vscode, kde, ...) 88 + โ”‚ โ”œโ”€โ”€ scripts/ # User scripts (update-all, verify-ssh-external, ...) 89 + โ”‚ โ””โ”€โ”€ programs/ # git, zsh, ssh, vscode, kde, ghostty, ... 80 90 โ”‚ 81 91 โ”œโ”€โ”€ settings/ # Platform-specific declarative settings 82 92 โ”‚ โ”œโ”€โ”€ darwin/ # macOS system.defaults (Dock, Finder, trackpad, etc.) ··· 86 96 โ”‚ โ”œโ”€โ”€ setup.sh # Key management helper 87 97 โ”‚ โ””โ”€โ”€ *.env / *.json / ... # Encrypted secret files 88 98 โ”‚ 99 + โ”œโ”€โ”€ hooks/ 100 + โ”‚ โ””โ”€โ”€ pre-commit # auto-format: nix, sh, rust, toml, md 101 + โ”‚ 89 102 โ”œโ”€โ”€ tools/ # Rust maintenance tools 90 - โ”‚ โ””โ”€โ”€ src/bin/ # health-check, flake-bump, gen-diff 103 + โ”‚ โ””โ”€โ”€ src/bin/ # health-check, flake-bump, gen-diff, server-config 91 104 โ””โ”€โ”€ wallpapers/ 92 105 ``` 93 106 94 107 ## Configuration Architecture 95 108 96 - All options are declared with typed defaults in `modules/options.nix`. Every system module reads values via `config.myConfig.*`; home-manager modules use `osConfig.myConfig.*`. No custom abstraction layer โ€” it's plain NixOS module system. 109 + All options are declared with typed defaults in `modules/options.nix`. 110 + Every system module reads values via `config.myConfig.*`; 111 + home-manager modules use `osConfig.myConfig.*`. No custom 112 + abstraction layer โ€” it's plain NixOS module system. 97 113 98 114 **To change a value for all hosts:** 99 115 ··· 126 142 127 143 ```bash 128 144 mkdir -p ~/.config 129 - curl -L https://github.com/ewanc26/nix/archive/refs/heads/main.tar.gz | tar -xz -C ~/.config 145 + curl -L \ 146 + https://github.com/ewanc26/nix/archive/refs/heads/main.tar.gz \ 147 + | tar -xz -C ~/.config 130 148 mv ~/.config/nix-main ~/.config/nix-config 131 149 cd ~/.config/nix-config 132 150 ``` ··· 165 183 nano settings/plasma/default.nix # KDE Plasma layout and behaviour 166 184 ``` 167 185 168 - See [`docs/settings.md`](docs/settings.md) for the full guide and [`docs/settings-config.md`](docs/settings-config.md) for the complete option reference. 186 + See [`docs/settings.md`](docs/settings.md) for the full guide and 187 + [`docs/settings-config.md`](docs/settings-config.md) for the 188 + complete option reference. 169 189 170 190 ## Maintenance 171 191 ··· 224 244 225 245 ## Inputs 226 246 227 - | Input | Version | 228 - | ----------------------------------------------------------------- | ---------------- | 229 - | [nixpkgs](https://github.com/NixOS/nixpkgs) | nixos-25.11 | 230 - | [home-manager](https://github.com/nix-community/home-manager) | release-25.11 | 231 - | [nix-darwin](https://github.com/LnL7/nix-darwin) | nix-darwin-25.11 | 232 - | [sops-nix](https://github.com/Mic92/sops-nix) | latest | 233 - | [plasma-manager](https://github.com/nix-community/plasma-manager) | latest | 247 + | Input | Version | 248 + | --- | --- | 249 + | [nixpkgs][nixpkgs] | nixos-25.11 | 250 + | [home-manager][home-manager] | release-25.11 | 251 + | [nix-darwin][nix-darwin] | nix-darwin-25.11 | 252 + | [sops-nix][sops-nix] | latest | 253 + | [plasma-manager][plasma-manager] | latest | 254 + 255 + [nixpkgs]: https://github.com/NixOS/nixpkgs 256 + [home-manager]: https://github.com/nix-community/home-manager 257 + [nix-darwin]: https://github.com/LnL7/nix-darwin 258 + [sops-nix]: https://github.com/Mic92/sops-nix 259 + [plasma-manager]: https://github.com/nix-community/plasma-manager 234 260 235 261 ## Unified Configuration Benefits 236 262 ··· 240 266 - **SSH** client configuration unified (connection multiplexing, agent integration) 241 267 - **Git** settings consistent across NixOS and macOS 242 268 - **Starship** prompt looks the same everywhere 269 + - **Ghostty** terminal configured identically on Linux and macOS 243 270 244 271 ### Platform-Specific When Needed 245 272 ··· 261 288 ### Host Management 262 289 263 290 - [`docs/hosts.md`](docs/hosts.md) โ€” hosts documentation index 264 - - [`docs/hosts-overview.md`](docs/hosts-overview.md) โ€” complete comparison of all three hosts 265 - - [`docs/hosts-modification.md`](docs/hosts-modification.md) โ€” how to modify and add hosts 266 - - [`docs/hosts-laptop.md`](docs/hosts-laptop.md) โ€” Dell Inspiron 3501 (NixOS + KDE Plasma 6) 291 + - [`docs/hosts-overview.md`](docs/hosts-overview.md) โ€” complete 292 + comparison of all three hosts 293 + - [`docs/hosts-modification.md`](docs/hosts-modification.md) โ€” 294 + how to modify and add hosts 295 + - [`docs/hosts-laptop.md`](docs/hosts-laptop.md) โ€” Dell Inspiron 296 + 3501 (NixOS + KDE Plasma 6) 267 297 - [`docs/hosts-server.md`](docs/hosts-server.md) โ€” headless server setup 268 298 - [`docs/hosts-macmini.md`](docs/hosts-macmini.md) โ€” macOS with nix-darwin 269 299 - [`docs/TAILSCALE-SSH.md`](docs/TAILSCALE-SSH.md) โ€” inter-host SSH over Tailscale ··· 271 301 ### Settings Management 272 302 273 303 - [`docs/settings.md`](docs/settings.md) โ€” settings overview 274 - - [`docs/settings-structure.md`](docs/settings-structure.md) โ€” why the config is modular 304 + - [`docs/settings-structure.md`](docs/settings-structure.md) โ€” 305 + why the config is modular 275 306 - [`docs/secrets.md`](docs/secrets.md) โ€” secrets management