8.nix-darwin/modules/system
Emily c449918bfb homebrew: move to system activation
This adds an optional explicit `homebrew.user` option that allows users
to avoid setting `system.primaryUser`, partly as a proof of concept
of what the interfaces should look like in the future. Homebrew only
officially support one global installation, so a singleton matches
upstream’s expectations; in practice, it may be useful for us to
nest this into `users.users.*.homebrew` instead, at the expense of
being an unsupported setup if used to its full potential. Since
that would be a breaking change to the inteface anyway, I think
adding `homebrew.user` for now is acceptable. (I think one native
Apple Silicon and one Rosetta 2 Homebrew installation – under
`/opt/homebrew` and `/usr/local` respectively – may be exceptions
to this lack of upstream support, but that would be complicated to
support even with `users.users.*.homebrew`.)

I’m not entirely sure where in system activation this should
go. Probably after the user defaults and launch agents stuff, to match
the existing logic in user activation, and I lean towards doing it
as late as possible; too early and we might not have the users and
groups required to bootstrap a Homebrew installation set up, but
as Homebrew installations could be fiddly and fail, doing it in the
middle could leave a partially‐activated system.

Probably it should be done in a launch agent or something instead, but
this is my best guess as to the appropriate place for now. The downside
is that activation scripts generally won’t be able to assume that the
Homebrew prefix is populated according to the current configuration,
but they probably shouldn’t be depending on that anyway?
2025-05-16 16:29:17 +01:00
..
defaults defaults: add com.apple.iCal for managing Calendar.app 2025-05-16 12:52:49 +10:00
activation-scripts.nix homebrew: move to system activation 2025-05-16 16:29:17 +01:00
applications.nix applications: Drop store prefix to generalize 2022-09-13 14:57:50 +02:00
base.nix system: remove unnecessary sudo 2025-01-14 15:56:20 +00:00
checks.nix primary-user: init 2025-05-16 16:29:17 +01:00
default.nix system: tweak ShellCheck settings 2025-01-18 19:34:21 +00:00
defaults-write.nix defaults: add com.apple.iCal for managing Calendar.app 2025-05-16 12:52:49 +10:00
etc.nix write-text: remove support for copy 2024-06-15 12:15:13 +01:00
keyboard.nix (feature) Add swapLeftCtrlAndFn 2024-08-05 13:00:32 +02:00
launchd.nix system: replace for f in $(ls ...) with for f in .../* 2024-11-07 17:20:00 +11:00
nvram.nix treewide: remove lib.mdDoc 2024-04-19 04:05:50 +02:00
patches.nix system: replace for f in $(ls ...) with for f in .../* 2024-11-07 17:20:00 +11:00
primary-user.nix primary-user: init 2025-05-16 16:29:17 +01:00
shells.nix users: allow shell to be managed by macOS 2024-10-27 21:52:41 +11:00
startup.nix treewide: remove lib.mdDoc 2024-04-19 04:05:50 +02:00
version.nix Docs: Fix references to NixOS 2025-03-06 16:24:46 +01:00