nix-darwin icon indicating copy to clipboard operation
nix-darwin copied to clipboard

Disable taking control of ~/Applications folder MkII

Open toonn opened this issue 3 years ago • 3 comments

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.

Note: This is a draft because I haven't had time to test it.

toonn avatar Jun 26 '22 08:06 toonn

@toonn can this be converted out of a Draft?

supermarin avatar Aug 31 '22 17:08 supermarin

I still haven't had time to test it. Until someone does I think this should stay a draft.

toonn avatar Sep 05 '22 09:09 toonn

I just had a chance to check this out (after discussing with @toonn in #macos:nixos.org) and can confirm that this seems to be working as intended. /Applications/Nix Apps is created with the installed app bundle symlinked into it. ~/Applications was removed entirely.

bbenne10 avatar Sep 14 '22 15:09 bbenne10

@LnL7 can we merge? @bbenne10 confirmed it's working

supermarin avatar Oct 18 '22 20:10 supermarin

@domenkozar any chance you can take a look at this PR?

Enzime avatar Nov 01 '22 02:11 Enzime