feat: consolidate nix binary caches into genebean module with system-manager support - #706
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
modules/genebean/data/nix-caches.nixas a single source of truth for all binary cache substituters and trusted public keys (Puppet Hiera pattern — pure Nix attrset, no module system)modules/genebean/nixos/nix-caches.nixandmodules/genebean/darwin/nix-caches.nixthat import the data file and wire it intonix.settingsmodules/genebean/system-manager/layer (new) withnix-caches.nixthat writes/etc/nix/nix.conf.d/genebean-caches.conffor HM-only Linux hosts; includes systemd path/service units that restartnix-daemon.serviceautomatically when the cache config changesmodules/hosts/home-manager-only/system.nixto add anincludedirective innix.custom.conffor the conf.d file (Determinate Nix does not auto-readnix.conf.d/; explicit include required)modules/hosts/nixos/default.nixandmodules/hosts/darwin/default.nixsystemManagerModules.genebeanintoflake.nixandlib/mkSystemConfig.nixmodules/genebean/README.mddocumenting 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 relationshippkgs/nixdiff/linux.shto show systemd unit additions/removals/changes from system-manager (previously only text-mode/etcfiles were shown)Test plan
nix run .#nixdiffbuilds cleanly (shellcheck passes) and shows systemd unit changes in outputnixupon rainbow-planet activates cleanly — system-manager wrote new etc files and loadednix-daemon-reload.path/nix-daemon-reload.servicewithout errornix-daemon.serviceactually restarts when cache config is touched (path unit fires)darwin/nix-caches.nix)nixos/nix-caches.nix)🤖 Generated with Claude Code