nix-darwin
nix-darwin copied to clipboard
Disable taking control of ~/Applications folder
Programs like Steam add applications to ~/Applications and such.
This PR disables linking ~/Applications
to nix-darwin applications in the /nix/store
and makes nix-darwin use a subfolder within ~/Applications
.
See https://github.com/rycee/home-manager/issues/1341#issuecomment-687286866
The feature is practical when using Alfred or any other launchers. My solution would require users to remove the ~/Applications folder manually if it points to the nix store.
I don't have any particular input but if the Applications directory symlinks into a nix-darwin generation, wouldn't it be safe to delete it before the mkdir
line?
Is there any interest in this PR or should I close it?
Should this PR be finally merged? I had this problem recently and spent a significant amount of time to get to this PR. Merging this PR should also unblock this: https://github.com/nix-community/home-manager/blob/master/modules/targets/darwin/linkapps.nix
@berbiche Is this working with Spotlight? I was under the impression that you have to copy the apps into ~/Applications
to get Spotlight to recognize them. Like
system = {
# Copy applications into ~/Applications/Nix Apps. This workaround allows us
# to find applications installed by nix through spotlight.
activationScripts.applications.text = pkgs.lib.mkForce (
''
rm -rf ~/Applications/Nix\ Apps
mkdir -p ~/Applications/Nix\ Apps
for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do
src="$(/usr/bin/stat -f%Y "$app")"
cp -rL "$src" ~/Applications/Nix\ Apps
done
''
);
};
This solution does not resolve the problem you highlighted @hardselius. It only makes nix-darwin interoperate with other tools and software by not taking ownership of the ~/Applications
folder (it becomes unwritable).
@LnL7 Would love to get this merged, so we can fix the home-manager
option too :)
@LnL7 this would be a welcome change on my side as well, and my understanding is that the mkdir -p ~/Applications
line satisfies all needs and requirements regarding that directory.
@LnL7 Any movement on this? I'm looking at making Darwin launchers more commonplace in nixpkgs
with Nixos/nixpkgs#131891. It'd be a shame for none of those launchers to be accessible.
Unfortunately, this issue is the major blocker for me adopting Nix & nix-darwin on my new Mac. I'd love to see this PR merged so the related issues in home-manager could be closed.
@LnL7 @berbiche It looks like the code has been reviewed but not approved. Is there a timeline for the approval and merge?
@LnL7 please take five minutes to review and merge. Don't make the community make a fork for a one liner change.
Is this ever going anywhere? I really want this feature.
@berbiche, this issue was discussed in the macOS room on Matrix. Consensus seems to be that apps managed my Nix-Darwin would actually be a better fit in /Applications
. Could you change the subfolder to be there rather than ~/Applications
? Might make this move forward again.
@berbiche, [...]. Could you change the subfolder to be there rather than
~/Applications
? Might make this move forward again.
Hi,
I am currently away from my computer and will not make this change for at least one week if not more.
I recommend submitting a new PR if you wish to see the issue resolved sooner or committing directly to my branch (if you are a contributor on this repository).
This can be closed since #470 was merged