nftable-migration
  1#+TITLE: =home= monorepo
  2#+FILETAGS: #home infra configuration dotfiles monorepo
  3
  4A comprehensive monorepo containing personal infrastructure, system
  5configurations, and tools, primarily built using [[https://nixos.org/nix][Nix]].
  6
  7* Overview
  8
  9This repository serves as a centralized location for:
 10- NixOS system configurations for multiple machines
 11- Home-manager configurations
 12- Custom tools and personal configurations
 13- Infrastructure management
 14
 15See [[file:CLAUDE.md][CLAUDE.md]] for Claude Code-specific guidance on working with this repository.
 16
 17* Repository Structure
 18
 19** =/systems=
 20Contains NixOS system configurations organized as follows:
 21- Individual host configurations (aix, aomi, athena, demeter, kyushu, sakhalin, rhea, kerkouane, etc.)
 22- Common configurations shared across systems:
 23  + Base system setup
 24  + Desktop environments (Sway, Niri)
 25  + Hardware-specific configurations
 26  + Program configurations
 27  + Service configurations
 28  + User management
 29
 30** =/home=
 31Home-manager configurations for different users and environments:
 32- Common configurations for desktop environments
 33- Development tools and settings:
 34  + AI tooling configuration (aichat, AI prompts/roles)
 35  + Go, Python, Nix development environments
 36  + Emacs configuration
 37  + Container tooling
 38- Shell configurations (zsh, tmux, etc.)
 39- Service configurations (syncthing, etc.)
 40
 41** =/dots=
 42Traditional dotfiles managed outside of home-manager:
 43- Niri window manager configuration
 44- Makefile-based dotfile installation system
 45- Additional application-specific configurations
 46
 47** =/tools=
 48Custom tools and utilities:
 49- DNS management scripts (show-dns.sh, update-gandi-dns.sh)
 50- Media management scripts (*arr stack automation)
 51- Battery monitor
 52- Emacs configuration
 53- Various Go-based utilities
 54
 55See [[file:tools/README.org][tools/README.org]] for detailed tool documentation.
 56
 57** =/pkgs=
 58Custom Nix packages and overlays including:
 59- Development tools (govanityurl, manifest-tool)
 60- System utilities (battery-monitor, systemd-email, vrsync)
 61- Custom scripts and utilities (ape, ram, batzconverter)
 62- Emacs packages
 63
 64** =/modules=
 65NixOS modules providing additional functionality:
 66- Wireguard client/server configurations
 67- Go vanity URL service
 68- Gosmee service
 69
 70** =/lib=
 71Core library functions for flake configuration:
 72- =mkHost= - Generate NixOS configurations
 73- =mkHome= - Generate home-manager configurations
 74- =mkSystemManager= - Generate system-manager configurations
 75- Helper functions for configuration building
 76
 77** =/overlays=
 78Nix overlays for:
 79- Custom package additions
 80- Package modifications
 81- Unstable package access
 82
 83** =/keyboards=
 84Hardware keyboard configurations with complete build and flash tooling.
 85
 86See [[file:keyboards/README.org][keyboards/README.org]] for detailed keyboard documentation and usage.
 87
 88*** Moonlander
 89Located in =/keyboards/moonlander=:
 90- QMK-based configuration for the ZSA Moonlander keyboard
 91- 72-key split ergonomic keyboard with RGB backlighting
 92- Wired USB-C connectivity
 93- See [[file:keyboards/moonlander/README.org][keyboards/moonlander/README.org]] for full documentation
 94
 95*** Eyelash Corne
 96Located in =/keyboards/eyelash_corne=:
 97- ZMK-based configuration for the wireless Corne (crkbd) keyboard
 98- 42-key split ergonomic keyboard with nice!view display
 99- Wireless Bluetooth connectivity with nice!nano v2
100- RGB underglow and custom animations
101- See [[file:keyboards/eyelash_corne/README.org][keyboards/eyelash_corne/README.org]] for full documentation
102
103*** Kanata (software)
104Located in =systems/kyushu/main.kbd=:
105- Software keyboard remapper configuration to mimic mechanical keyboards
106- System-level key remapping for non-keyboard hardware
107
108** =/imperative=
109Idempotent configuration scripts for systems not managed by NixOS, organized by hostname:
110- Each host has its own directory (e.g., =/imperative/nagoya/=)
111- Scripts are designed to be run repeatedly to maintain system state
112- Primary script in each host directory is typically =apply.sh=
113- Used for bootstrapping and ongoing configuration management of non-NixOS systems (Debian, Arch, Windows, etc.)
114
115Examples of hosts that may have imperative configurations:
116- =nagoya= - Debian-based system (server)
117- =wakasu= - Fedora-based system (desktop)
118- Additional systems running operating systems other than NixOS
119
120* Usage
121
122The main entry point is =flake.nix=, which provides:
123
124- NixOS configurations for various hosts
125- Home-manager configurations
126- System-manager configurations
127- Custom packages and overlays
128
129** Building a System
130
131To build and activate a system configuration:
132
133#+begin_src bash
134nixos-rebuild switch --flake .#<hostname>
135#+end_src
136
137** Installing a New System
138
139For new systems that already have a configuration in this repository,
140you can use the =install.sh= script which uses =disko= for disk
141partitioning and installation:
142
143#+begin_src bash
144./install.sh <hostname> [additional-disko-options]
145#+end_src
146
147This will:
1481. Use the disko-install tool to partition and format disks
1492. Install the system configuration for the specified hostname
150
151** Available Make Targets
152
153The repository includes several useful make targets for common operations:
154
155*** System Management
156- =make boot= - Build and boot the current system configuration
157- =make switch= - Build and switch to the new system configuration
158- =make build= - Build the system configuration without activating
159- =make dry-build= - Test build the configuration without making changes
160
161*** Remote Host Management
162- =make host/<hostname>/build= - Build configuration for a specific host
163- =make host/<hostname>/boot= - Build and boot configuration on a remote host
164- =make host/<hostname>/switch= - Build and switch configuration on a remote host
165
166*** Development
167- =make fmt= - Format Nix files using nixpkgs-fmt
168- =make pre-commit= - Run pre-commit checks
169
170*** Keyboards
171- =make keyboards/moonlander/build= - Build Moonlander QMK firmware
172- =make keyboards/moonlander/flash= - Build and flash Moonlander firmware
173- =make keyboards/moonlander/update= - Update QMK submodules
174- =make keyboards/moonlander/clean= - Clean Moonlander build artifacts
175- =make keyboards/eyelash_corne/build= - Build Eyelash Corne ZMK firmware
176- =make keyboards/eyelash_corne/flash= - Build and flash Eyelash Corne firmware
177- =make keyboards/draw= - Generate keymap SVGs for all keyboards
178- =make keyboards/moonlander/draw= - Generate keymap SVG for Moonlander
179- =make keyboards/eyelash_corne/draw= - Generate keymap SVG for Eyelash Corne
180
181See [[file:keyboards/README.org][keyboards/README.org]] for detailed keyboard documentation.
182
183*** DNS Management
184- =make dns-show= - Display DNS zone configuration from NixOS
185- =make dns-update-gandi= - Sync DNS records to Gandi Live DNS
186- =make dns-update-gandi-dry-run= - Preview DNS changes without applying
187
188See [[file:tools/README.org][tools/README.org]] for detailed DNS tool documentation.
189
190*** Media Management (*arr Stack)
191
192Default URLs and API keys (from passage) are configured for =*.sbr.pm= services.
193Override via environment variables or make arguments if needed.
194
195**** Lidarr
196- =make lidarr-rename= - Rename albums in Lidarr with confirmation
197- =make lidarr-rename EXTRA_ARGS="--dry-run"= - Preview album renames
198- =make lidarr-retag= - Retag albums in Lidarr with confirmation
199- =make lidarr-retag EXTRA_ARGS="--dry-run"= - Preview album retags
200- =make lidarr-update-paths= - Update artist paths (requires =LIDARR_ROOT_PATH=)
201
202**** Sonarr
203- =make sonarr-rename= - Rename TV series episodes with confirmation
204- =make sonarr-rename EXTRA_ARGS="--dry-run"= - Preview episode renames
205
206**** Radarr
207- =make radarr-rename= - Rename movies with confirmation
208- =make radarr-rename EXTRA_ARGS="--dry-run"= - Preview movie renames
209
210**** Examples
211#+begin_src bash
212# Use defaults (*.sbr.pm with passage API keys)
213make lidarr-rename
214
215# Dry-run mode
216make sonarr-rename EXTRA_ARGS="--dry-run"
217
218# Override URL and API key (e.g., for local testing)
219make radarr-rename RADARR_URL=http://localhost:7878 RADARR_API_KEY=mykey
220
221# Use --no-confirm flag
222make lidarr-retag EXTRA_ARGS="--no-confirm"
223#+end_src
224
225See [[file:tools/README.org][tools/README.org]] for detailed *arr tool documentation.
226
227*** Maintenance
228- =make clean= - Clean up old system generations and results
229- =make clean-system= - Remove system generations older than 15 days
230- =make clean-results= - Remove symlinks to build results
231- =nix flake update= - Update flake inputs (nixpkgs, home-manager, etc.)
232
233** Updating Home Configuration
234
235To update home-manager configuration:
236
237#+begin_src bash
238home-manager switch --flake .#<username>@<hostname>
239#+end_src
240
241** Managing Dotfiles
242
243For configurations not managed by home-manager, the =/dots= directory
244provides a Makefile-based installation system:
245
246#+begin_src bash
247cd dots
248make all  # Install all dotfiles
249make niri # Install only niri configuration
250#+end_src
251
252** Managing Non-NixOS Systems
253
254For systems not managed by NixOS, the =/imperative= directory provides
255idempotent configuration scripts organized by hostname.
256
257See [[file:imperative/README.org][imperative/README.org]] for detailed documentation.
258
259*** Running Configuration Scripts
260
261#+begin_src bash
262# Apply configuration for a specific host
263sudo ./imperative/<hostname>/apply.sh
264
265# With environment variables (e.g., for wireguard)
266sudo WG_PRIVATE_KEY="..." ./imperative/<hostname>/apply.sh
267#+end_src
268
269*** Available Hosts
270
271**** nagoya (Debian Server)
272#+begin_src bash
273# Configure nagoya with wireguard
274sudo WG_PRIVATE_KEY="your-key" ./imperative/nagoya/apply.sh
275#+end_src
276
277Installs: Docker, Kind, Wireguard, Syncthing
278
279See [[file:imperative/nagoya/README.org][imperative/nagoya/README.org]] for details.
280
281**** wakasu (Fedora Desktop)
282#+begin_src bash
283# Configure wakasu
284sudo ./imperative/wakasu/apply.sh
285
286# With wireguard
287sudo WG_PRIVATE_KEY="your-key" ./imperative/wakasu/apply.sh
288#+end_src
289
290Installs: Helix, ACPI, Wireguard, Syncthing
291
292See [[file:imperative/wakasu/README.org][imperative/wakasu/README.org]] for details.
293
294** Building and Installing Packages
295
296The repository provides various custom packages that can be built and installed directly from the flake:
297
298*** Building a Single Package
299To build a specific package:
300
301#+begin_src bash
302nix build .#<package-name>
303#+end_src
304
305*** Installing a Package
306To install a package in your profile:
307
308#+begin_src bash
309nix profile install .#<package-name>
310#+end_src
311
312*** Available Packages
313All packages are defined in the =/pkgs= directory and are available for both =x86_64-linux= and =aarch64-linux= systems. Notable packages include:
314
315**** Development Tools
316- =battery-monitor= - System battery monitoring utility
317- =govanityurl= - Go vanity URL service
318- =manifest-tool= - Container manifest tool
319
320**** Chmouzies (Helper Scripts)
321- =chmouzies-ai= - AI-related helper scripts
322- =chmouzies-git= - Git workflow helpers
323- =chmouzies-kubernetes= - Kubernetes utilities
324
325**** System Utilities
326- =vrsync= - Custom rsync utility
327- =vde-thinkpad= - ThinkPad-specific utilities
328- =systemd-email= - Email notifications for systemd
329- =nixfmt-plus= - Enhanced Nix formatter
330
331**** Custom Scripts
332- =scripts= - Collection of utility scripts for various tasks
333- =ape= - Custom utility package
334- =ram= - Custom utility package
335- =batzconverter= - Custom conversion utility
336
337**** Emacs Packages
338- =bookmark-plus= - Enhanced bookmarking for Emacs
339
340To list all available packages:
341
342#+begin_src bash
343nix flake show
344#+end_src
345
346* Development
347
348A development shell is provided with necessary tools:
349- Git
350- Prettier
351- Deadnix
352- nixfmt-rfc-style
353- agenix
354
355To enter the development environment:
356
357#+begin_src bash
358nix develop
359#+end_src
360
361Pre-commit hooks are configured for:
362- Go formatting (gofmt)
363- Nix formatting (nixfmt-rfc-style) and linting (deadnix)
364- Python linting (flake8, ruff)
365- Shell script checking (shellcheck)
366
367** Continuous Integration
368
369GitHub Actions workflows automatically:
370- Build all NixOS system configurations
371- Build all custom packages
372- Build keyboard firmware (Corne, Moonlander)
373- Run automated flake updates via Dependabot
374
375* Supported Systems
376
377- =x86_64-linux=
378- =aarch64-linux=
379
380** Current Hosts
381
382*** Desktop Systems (unstable)
383- =kyushu= - Work laptop (Niri desktop)
384- =foobar= - Test VM (Niri desktop)
385
386*** Servers (unstable)
387- =aomi= - Server
388- =sakhalin= - Server
389
390*** Servers (stable, NixOS 25.05)
391- =athena= - Raspberry Pi 4
392- =demeter= - Raspberry Pi 4
393- =aix= - Raspberry Pi 4
394- =aion= - aarch64 server
395- =rhea= - aarch64 server
396- =kerkouane= - =x86_64= server
397
398*** Non-NixOS Systems (Imperative Configuration)
399- =nagoya= - Debian server (aarch64)
400- =wakasu= - Fedora desktop
401
402See [[file:imperative/README.org][imperative/README.org]] for details on managing these systems.
403
404* References
405
406Repositories that inspired or contributed to this configuration:
407
408** Active References
409- [[https://github.com/jordanisaacs/dotfiles][https://github.com/jordanisaacs/dotfiles]]
410- [[https://github.com/chvp/nixos-config][https://github.com/chvp/nixos-config]]
411- [[https://github.com/gytis-ivaskevicius/nixfiles][https://github.com/gytis-ivaskevicius/nixfiles]]
412- [[https://github.com/davidtwco/veritas][https://github.com/davidtwco/veritas]]
413- [[https://github.com/buckley310/nixos-config][https://github.com/buckley310/nixos-config]]
414- [[https://github.com/eadwu/nixos-configuration][https://github.com/eadwu/nixos-configuration]]
415- [[https://github.com/berbiche/dotfiles][https://github.com/berbiche/dotfiles]]
416- [[https://github.com/hlissner/dotfiles][https://github.com/hlissner/dotfiles]]
417- [[https://github.com/Mic92/dotfiles][https://github.com/Mic92/dotfiles]]
418- [[https://github.com/lovesegfault/nix-config][https://github.com/lovesegfault/nix-config]]
419- [[https://github.com/bqv/nixrc][https://github.com/bqv/nixrc]]
420- [[https://github.com/leotaku/nixos-config][https://github.com/leotaku/nixos-config]]
421- [[https://github.com/rasendubi/dotfiles][https://github.com/rasendubi/dotfiles]]
422- [[https://git.tazj.in/about/][https://git.tazj.in/about/]]
423- [[https://github.com/danieldk/nix-home][https://github.com/danieldk/nix-home]]
424- [[https://github.com/terlar/nix-config][https://github.com/terlar/nix-config]]
425  + [[https://github.com/terlar/emacs-config][https://github.com/terlar/emacs-config]]
426- [[https://github.com/foo-dogsquared/nixos-config][https://github.com/foo-dogsquared/nixos-config]]
427- [[https://github.com/barrucadu/nixfiles][https://github.com/barrucadu/nixfiles]]
428- [[https://github.com/EmergentMind/nix-config][https://github.com/EmergentMind/nix-config]]
429- [[https://github.com/shahinism/45r4r][https://github.com/shahinism/45r4r]]
430- [[https://github.com/wimpysworld/nix-config][https://github.com/wimpysworld/nix-config]]
431- [[https://github.com/Hoverbear-Consulting/flake][https://github.com/Hoverbear-Consulting/flake]]
432- [[https://github.com/jnsgruk/nixos-config][https://github.com/jnsgruk/nixos-config]]
433- [[https://gitlab.com/ahoneybun/nix-configs][https://gitlab.com/ahoneybun/nix-configs]]
434- [[https://github.com/akirak/homelab][https://github.com/akirak/homelab]]
435- [[https://git.sr.ht/~akirak/nix-config][https://git.sr.ht/~akirak/nix-config]]
436- [[https://github.com/akirak/nix-desktop][https://github.com/akirak/nix-desktop]]
437- [[https://git.rossabaker.com/ross/cromulent][https://git.rossabaker.com/ross/cromulent]]
438- [[https://github.com/thiagokokada/nix-configs][https://github.com/thiagokokada/nix-configs]]
439- [[https://github.com/JRMurr/NixOsConfig][https://github.com/JRMurr/NixOsConfig]]
440- [[https://github.com/dzervas/dotfiles][https://github.com/dzervas/dotfiles]]
441- https://github.com/mirdaki/computer-config
442- https://github.com/Suya1671/commafiles
443- https://github.com/caelestia-dots/shell
444
445** Historical References
446- [[https://gitlab.com/samueldr/nixos-configuration][https://gitlab.com/samueldr/nixos-configuration]]
447- [[https://github.com/yurrriq/dotfiles][https://github.com/yurrriq/dotfiles]]
448- [[https://github.com/akirak/nixos-config][https://github.com/akirak/nixos-config]]
449- [[https://github.com/akirak/home.nix][https://github.com/akirak/home.nix]]
450- [[https://github.com/cstrahan/nixos-config][https://github.com/cstrahan/nixos-config]]
451- [[https://github.com/jwiegley/nix-config][https://github.com/jwiegley/nix-config]]
452- [[https://github.com/arianvp/nixos-stuff][https://github.com/arianvp/nixos-stuff]]
453- [[https://github.com/romatthe/ronix][https://github.com/romatthe/ronix]]
454- [[https://github.com/rummik/nixos-config][https://github.com/rummik/nixos-config]]
455- [[https://github.com/a-schaefers/nix-config.old][https://github.com/a-schaefers/nix-config.old]]
456- [[https://github.com/auntieNeo/nixrc][https://github.com/auntieNeo/nixrc]]
457- [[https://github.com/glines/nixrc][https://github.com/glines/nixrc]]
458- [[https://github.com/therealpxc/pxc.nix.d][https://github.com/therealpxc/pxc.nix.d]]
459- [[https://github.com/tycho01/nix-config][https://github.com/tycho01/nix-config]]
460- [[https://github.com/ghuntley/dotfiles-nixos][https://github.com/ghuntley/dotfiles-nixos]]
461- [[https://github.com/budevg/nix-conf][https://github.com/budevg/nix-conf]]
462- [[https://github.com/cleverca22/nixos-configs][https://github.com/cleverca22/nixos-configs]]
463- [[https://github.com/coreyoconnor/nix_configs][https://github.com/coreyoconnor/nix_configs]]
464- [[https://github.com/dejanr/dotfiles][https://github.com/dejanr/dotfiles]]
465- [[https://github.com/Ericson2314/nixos-configuration][https://github.com/Ericson2314/nixos-configuration]]
466- [[https://gitlab.com/garry-cairns/nixos-config][https://gitlab.com/garry-cairns/nixos-config]]
467- [[https://github.com/grahamc/nixos-config][https://github.com/grahamc/nixos-config]]
468- [[https://github.com/HugoReeves/nix-home][https://github.com/HugoReeves/nix-home]]
469- [[https://github.com/kampfschlaefer/nixconfig][https://github.com/kampfschlaefer/nixconfig]]
470- [[https://github.com/lambdael/nixosconf][https://github.com/lambdael/nixosconf]]
471- [[https://github.com/puffnfresh/nix-files][https://github.com/puffnfresh/nix-files]]
472- [[https://github.com/talyz/nixos-config][https://github.com/talyz/nixos-config]]
473- [[https://github.com/uwap/nixos-configs][https://github.com/uwap/nixos-configs]]
474- [[https://github.com/yacinehmito/yarn-nix][https://github.com/yacinehmito/yarn-nix]]
475- [[https://github.com/yrashk/nix-home][https://github.com/yrashk/nix-home]]
476- [[https://github.com/pSub/configs][https://github.com/pSub/configs]]
477- [[https://github.com/periklis/nix-config][https://github.com/periklis/nix-config]]
478- [[https://github.com/peel/dotfiles][https://github.com/peel/dotfiles]]
479- [[https://github.com/bennofs/etc-nixos][https://github.com/bennofs/etc-nixos]]
480- [[https://github.com/Baughn/machine-config][https://github.com/Baughn/machine-config]]
481- [[https://github.com/gvolpe/nix-config][https://github.com/gvolpe/nix-config]]
482- [[https://github.com/myme/dotfiles][https://github.com/myme/dotfiles]]
483- [[https://github.com/jedimahdi/.dotfiles][https://github.com/jedimahdi/.dotfiles]]
484- [[https://github.com/moni-dz/nix-config][https://github.com/moni-dz/nix-config]]
485- [[https://github.com/Aylur/dotfiles][https://github.com/Aylur/dotfiles]]
486- [[https://gitlab.com/Zaney/zaneyos][https://gitlab.com/Zaney/zaneyos]]
487- [[https://github.com/spikespaz/dotfiles][https://github.com/spikespaz/dotfiles]]
488- [[https://github.com/fufexan/dotfiles][https://github.com/fufexan/dotfiles]]
489- [[https://github.com/hlissner/dotfiles][https://github.com/hlissner/dotfiles]]
490- [[https://github.com/librephoenix/nixos-config][https://github.com/librephoenix/nixos-config]]
491- [[https://github.com/AntonHakansson/nixos-config][https://github.com/AntonHakansson/nixos-config]]
492
493* Licensing
494
495Unless otherwise stated in a subdirectory, all code is licensed under the GNU GPL v3. See [[file:COPYING][COPYING]] for details.