8.nix-darwin/modules/system
toonn fbe795f39d
applications: Symlink Nix Apps to /Applications
This PR supercedes #226.

So far application bundles were always linked to `~/Applications` or
`~/Applications/Nix Apps` if the former was an existing directory.

In nix-community/home-manager#1341 a conflict was found with suggested
new Home Manager behavior, where applications installed through Home
Manager would end up in `~/Applications/Home Manager Apps`. This was in
an attempt to make them discoverable through Spotlight but further
investigation suggest Spotlight does not pick up symlinked apps (details
in the issue).

However, there are other programs that expect to be able to write to
`~/Applications` so taking over the directory is unfortunate.

PR #226 dropped linking `~/Applications` and instead made sure the
directory exists so we can always link in `~/Applications/Nix Apps`.

After further discussion in #macos:nixos.org we came to the conclusion
that we shouldn't link applications to a user directory at all. Since we
manage packages for multiple users, application bundles should go in
`/Applications`.

Because previous code will likely leave a symlink at
`~/Applications/{,Nix Apps}`, which will become dangling once the path
it links to is garbage collected from the store we test to see if a link
exists and it conforms to the path we're expecting and if it does remove
it.
2022-09-13 14:57:46 +02:00
..
defaults Transition to using native floats 2022-08-29 15:39:16 -07:00
activation-scripts.nix Move programs.brew-bundle to homebrew 2020-12-17 13:03:57 -08:00
applications.nix applications: Symlink Nix Apps to /Applications 2022-09-13 14:57:46 +02:00
checks.nix Add .nix-defexpr to NIX_PATH the way the NixOS module does 2022-08-16 17:41:08 -07:00
default.nix system: add patches module 2020-05-29 21:29:20 +02:00
defaults-write.nix Transition to using native floats 2022-08-29 15:39:16 -07:00
etc.nix Remove deprecated types.loaOf 2020-09-02 04:20:00 +00:00
flake-overrides.nix disable NIX_PATH checks when using flakes 2020-10-25 12:56:39 +01:00
keyboard.nix add new option - system.keyboard.swapLeftCommandAndLeftAlt 2020-10-23 22:47:38 +08:00
launchd.nix Remove deprecated types.loaOf 2020-09-02 04:20:00 +00:00
patches.nix add forward compatibility for literalExample deprecation 2021-10-23 15:06:42 +02:00
shells.nix add forward compatibility for literalExample deprecation 2021-10-23 15:06:42 +02:00
version.nix add flake versions 2020-10-21 18:30:56 +02:00