All existing attempts fell short.
So we fall back to plain old copying applications over.
Problems with alternatives:
- Symlinking: Spotlight doesn't index symlinks. Therefore one cannot use
Spotlight to find or open the apps. Also they don't show up in
LaunchPad.
- Trampolines: Apples Security & Privacy doesn't get the concept and
shows them with the wrong name. Having an app open during an update will
also make it show up twice in the Dock.
- Aliasses: Require either AppleScript (a permission we don't want to
have, as it easily bypasses Apples TCC) or extra tools (that would be
ok), but also Aliasses are not categorized as 'Application' by
SpotLight.
- Directory Hardlinks are not supported by APFS - but also wouldn't work
cross volume.
- clonefile also doesn't work cross-volume.
Which all leads us back to Don Copine and Pastone. *sigh*
- Replace deprecated homebrew/cask-fonts with apple/apple tap example
- Update documentation links from archived homebrew-bundle to brew.sh/Brew-Bundle-and-Brewfile
- Update source file references to new location in main brew repository
Some systems set `secure_path` in sudoers. When this is set
the `PATH` variable is not set in the sudo environment. Using
`--preserve-env=PATH` ensures that the PATH env var is set properly
in those systems.
This is similar to the issue with [darwin-rebuild](https://github.com/nix-darwin/nix-darwin/issues/798)
not working with sudo on these systems.
I've personally set it to `null` to make my `system.primaryUser = null;`
configuration work on a machine with `stateVersion = 4;`.
It may apply in other use cases as well.
This fixes an unnecessary evaluation dependency that prevented the
custom and much appreciated primaryUser error from popping up.
Specifically:
… while evaluating the option `system.build':
… while evaluating definitions from `/nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/environment':
… while evaluating definitions from `/nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/nix':
… while evaluating the option `environment.darwinConfig':
… while evaluating the option `system.primaryUserHome':
error: expected a string but found null: null
at /nix/store/lc6n4bhxj9255kzfn9pnpx65583a8cgc-source/modules/system/primary-user.nix:26:30:
25| default =
26| config.users.users.${config.system.primaryUser}.home or "/Users/${config.system.primaryUser}";
| ^
27| };
While it did have some indication as to the cause, it lets the good
error message go to waste.
**Context**
`lazyAttrsOf` is the better choice when you use an attrset as individual
variables instead of in aggregate (e.g. `attrNames`, `toJSON`).
The reason is that an expression like `a.b` is strict in `a`, which
entails the evaluating the _whole_ set of attribute _names_ in `a`.
In the `attrsOf` this means evaluating all `mkIf` conditions, which
in turn also means evaluating all the regular definitions to the
smallest degree (WHNF) to determine that they're not `mkIf`s.
`lazyAttrsOf` simply assumes that all attributes aren't `mkIf false`,
and throws an error in the attribute value if necessary.
This would be a problem with `toJSON` and such, but is completely
fine when the attributes are treated as variables of a lazy program,
as is the case here.
**NixOS**
NixOS made `system.build` a submodule with a `freeformType`, allowing
the things inside of it to be declared, and for them to have niceties
like documentation and merging behavior.
nix-darwin could probably adopt this.
These can’t be relied upon in a post‐user‐activation
world. Technically a breaking change, if anyone has their home
directory outside of `/Users` or is using `root` for this, but, well,
I did my best and these are legacy defaults anyway.