feat: switch fi (darwin) to Determinate Nix, keep caches declarative - #137
Merged
Merged
Conversation
Import `determinate.darwinModules.default` on the fi host so Determinate Nix manages /etc/nix instead of nix-darwin. The module forces `nix.enable = false` (no nix-darwin-managed nix.conf, store stays intact) and exposes `determinateNix.*`, which keeps everything in the flake. - determinate.nix: import the module, mirror substituters/keys from the repo-wide `caches` aggregate into `determinateNix.customSettings` (extra-substituters / extra-trusted-public-keys), plus pipe-operators and trusted-users. All `extra-*` so Determinate's own defaults are preserved. - system.nix: drop `nix.enable`/`nix.settings` (inert once Determinate owns nix.conf); settings relocated to customSettings. - linux-builder.nix: port `nix.linux-builder` -> the equivalent `determinateNix.nixosVmBasedLinuxBuilder` (same VM, ephemeral, both systems, same tuning). nix-darwin's own block asserts `nix.enable`, which is now off. - flake.nix/flake-file: add the `determinate` input (flakehub v3). flake.nix is regenerated from flake-file; run `nix run .#write-flake` to confirm no drift. flake.lock is updated on first eval (new input auto-locks). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiWwUjG4R8X4cN5qwng4Zn
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.
What
Switch the
fimacOS host from nix-darwin-managed Nix to Determinate Nix, while keeping every cache/substituter and Nix setting declarative in the flake. The store is not reinstalled — Determinate takes over/etc/nix, nix-darwin keeps doing everything else.How it works
Importing
inputs.determinate.darwinModules.defaultdoes two things itself:nix.enable = lib.mkForce false(nix-darwin no longer writes/etc/nix/nix.conf), anddeterminateNix.*, which writes/etc/nix/nix.custom.confand/etc/determinate/config.json.So this is the third option — not "let nix-darwin manage the install" and not "set
nix.enable = falseand hand-editnix.custom.conf". Config stays in the flake underdeterminateNix.*.Changes
modules/fi/determinate.nix(new) — import the Determinate darwin module and configuredeterminateNix.customSettings:extra-substituters/extra-trusted-public-keysreuse the repo-widecachesaggregate (modules/nixpkgs/substituters.nix), the same list that feeds the flakenixConfigand the NixOS hosts — so the Mac stays in sync.extra-experimental-features = [ "pipe-operators" ]andtrusted-users.extra-*(additive) so Determinate's own defaults (nix-command/flakes, cache.nixos.org, the FlakeHub cache) are preserved rather than clobbered.modules/fi/system.nix— dropnix.enable/nix.settings(inert once Determinate ownsnix.conf); those settings now live incustomSettings.modules/fi/linux-builder.nix— portnix.linux-builder→determinateNix.nixosVmBasedLinuxBuilder. Same Nixpkgsdarwin.linux-builderVM, sameephemeral, bothaarch64-linux/x86_64-linux, same tuning (6 cores / 40 GB disk / 8 GB mem), samebuilder@localhost:31022. nix-darwin's ownnix.linux-buildercan't be used here because it assertsnix.enable, which Determinate forces off. (Determinate also ships a native Virtualization.framework builder; this keeps the existing VM verbatim.)flake.nix/ flake-file — add thedeterminateinput (flakehub.com/f/DeterminateSystems/determinate/3).Follow-ups before activating on the Mac
This environment has no
nix, so two generated artifacts couldn't be produced here:flake.nixwas hand-edited to mirror whatwrite-flakeproduces — runnix run .#write-flaketo confirm there's no drift.flake.lockdoes not yet contain thedeterminateinput — it auto-locks on the first eval (darwin-rebuild/nix flake check), or runnix flake lockto lock it explicitly.Activate with
just darwin-switch fi(orjust darwin-bootstrap fion a fresh machine).🤖 Generated with Claude Code
Generated by Claude Code