Skip to content

feat: consolidate nix binary caches into genebean module with system-manager support - #706

Merged
genebean merged 3 commits into
mainfrom
substituters
Jul 22, 2026
Merged

feat: consolidate nix binary caches into genebean module with system-manager support#706
genebean merged 3 commits into
mainfrom
substituters

Conversation

@genebean

@genebean genebean commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add modules/genebean/data/nix-caches.nix as a single source of truth for all binary cache substituters and trusted public keys (Puppet Hiera pattern — pure Nix attrset, no module system)
  • Add modules/genebean/nixos/nix-caches.nix and modules/genebean/darwin/nix-caches.nix that import the data file and wire it into nix.settings
  • Add modules/genebean/system-manager/ layer (new) with nix-caches.nix that writes /etc/nix/nix.conf.d/genebean-caches.conf for HM-only Linux hosts; includes systemd path/service units that restart nix-daemon.service automatically when the cache config changes
  • Update modules/hosts/home-manager-only/system.nix to add an include directive in nix.custom.conf for the conf.d file (Determinate Nix does not auto-read nix.conf.d/; explicit include required)
  • Remove the now-duplicate cache lists from modules/hosts/nixos/default.nix and modules/hosts/darwin/default.nix
  • Wire systemManagerModules.genebean into flake.nix and lib/mkSystemConfig.nix
  • Add modules/genebean/README.md documenting the full module architecture: data/, home/, darwin/, nixos/, system-manager/ layers, namespacing, genebeanLib flags, all module patterns, and the nix.conf.d / nix.custom.conf relationship
  • Enhance pkgs/nixdiff/linux.sh to show systemd unit additions/removals/changes from system-manager (previously only text-mode /etc files were shown)

Test plan

  • nix run .#nixdiff builds cleanly (shellcheck passes) and shows systemd unit changes in output
  • nixup on rainbow-planet activates cleanly — system-manager wrote new etc files and loaded nix-daemon-reload.path / nix-daemon-reload.service without error
  • Verify nix-daemon.service actually restarts when cache config is touched (path unit fires)
  • Verify Darwin build still evaluates cleanly (no regression in darwin/nix-caches.nix)
  • Verify NixOS host still evaluates cleanly (no regression in nixos/nix-caches.nix)

🤖 Generated with Claude Code

genebean and others added 3 commits July 21, 2026 22:00
Adds modules/genebean/data/nix-caches.nix as the single source of truth
for fleet-wide binary cache substituters and trusted public keys. The data/
directory follows a Puppet Hiera-like pattern: plain Nix attrsets with no
module system dependency, importable by any layer that needs the values.

Adds a system-manager layer to the genebean module system
(modules/genebean/system-manager/) alongside the existing home, darwin, and
nixos layers. Wired into flake.nix as systemManagerModules.genebean and
imported by lib/mkSystemConfig.nix.

Each platform layer imports the data file and applies it in the format its
module system expects: nix.settings on NixOS and nix-darwin,
environment.etc."nix/nix.conf.d/genebean-caches.conf" on system-manager.
Cache entries removed from modules/hosts/nixos/default.nix,
modules/hosts/darwin/default.nix, and modules/hosts/home-manager-only/system.nix.

Also adds modules/genebean/README.md documenting the directory layout,
all four module layers, the data/ pattern, namespacing conventions,
genebeanLib flags, and all module patterns in use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add systemd path/service units to nix-caches.nix so nix-daemon is
restarted automatically whenever /etc/nix/nix.conf.d/genebean-caches.conf
changes, without requiring manual intervention.

Wire up the conf.d include in system.nix (nix.custom.conf) so Determinate
Nix picks up the file. Add a comment in system.nix explaining the pattern:
one include line per genebean system-manager module that writes under
nix.conf.d/.

Document the nix.conf.d / nix.custom.conf relationship and the include
pattern in the genebean README.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ly hosts

system-manager manages units via a source directory entry in etcFiles.json
(not a text entry), so they were invisible to the existing text-file loop.

Add a new section in the HM-only branch that reads the systemd/system source
path from both the new build and the current profile, resolves the symlink
chains to the actual units directories, and reports added (-), removed (-),
and changed (diff) unit files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@genebean
genebean merged commit 03abd17 into main Jul 22, 2026
2 checks passed
@genebean
genebean deleted the substituters branch July 22, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant