feat(darwin): wire nix-homebrew and make Homebrew authoritative

Add the nix-homebrew input and darwin module so the Homebrew prefix is installed and owned declaratively (no manual bootstrap), with enableRosetta for x86_64 formulae on Apple Silicon and user = host username.

Set homebrew.onActivation.cleanup = zap so the taps/brews/casks/masApps lists are authoritative: anything not declared is removed on activation.
This commit is contained in:
Emma Thorpe
2026-06-02 15:56:37 +00:00
parent 532e581696
commit e67bc0f4d5
3 changed files with 52 additions and 6 deletions
Generated
+36
View File
@@ -1,5 +1,22 @@
{
"nodes": {
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1778427648,
"narHash": "sha256-pt9KaDGsMyYWB9JeHs4XGHs870f1lOZe3vx9LpVIhUE=",
"owner": "Homebrew",
"repo": "brew",
"rev": "6f293daa9f9f5832e13b497976335e90509886d7",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "5.1.11",
"repo": "brew",
"type": "github"
}
},
"flake-compat": {
"locked": {
"lastModified": 1761640442,
@@ -93,6 +110,24 @@
"type": "github"
}
},
"nix-homebrew": {
"inputs": {
"brew-src": "brew-src"
},
"locked": {
"lastModified": 1778851564,
"narHash": "sha256-p8wzcnpB2Iys+QzAKM9/Eyw/pUyqCO3sw/NCnDH4dTE=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "b3a87b4793205cc111f3c61e25e018ffac3b8039",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "nix-homebrew",
"type": "github"
}
},
"nixos-apple-silicon": {
"inputs": {
"flake-compat": "flake-compat",
@@ -171,6 +206,7 @@
"flake-parts": "flake-parts",
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew",
"nixos-apple-silicon": "nixos-apple-silicon",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs",