Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix-darwin: hide trampolines in /Applications, status message for darwin-rebuild #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

christian-burger
Copy link
Contributor

Not sure if that's only happening on my system or no one else is a tiny bit annoyed about that 😅 … but on my system there are always two almost identical folders in /Applications.

Screenshot 2025-03-14 at 16 37 45

I think one folder suffices. So I hid the trampolines with chflags. One could make this hiding of the folder optional and an option in the cli-tool and nix-darwin configuration. But I don't see a reason why, since the intent of the "mac-app-util" is to make it available to Spotlight et al. And that's done, even if the folder is being hidden. 🤷

And while I was at it, I added a message about what's happening for when nix-darwin rebuilds the system.

By submiting this PR, I agree to license this contribution under Creative Commons’ CC0 license.

@hraban
Copy link
Owner

hraban commented Mar 14, 2025

I respect the choice, though on first thought I don't think I will mainline this, in the spirit of "explicit is better than implicit". The two folders are fundamentally distinct and the distinction is important. But I can see the appeal.

@christian-burger
Copy link
Contributor Author

Maybe, I could convince you to integrate the patch, when I make it an option in the configuration as proposed? And the default to not hide the folder? So, nothing would change for people not explicitly configuring this setting. Does that work with your idea of "explicit is better than implicit"?

@hraban
Copy link
Owner

hraban commented Mar 16, 2025

Out of curiousity, can you try adding your configuration using lib.mkAfter? E.g.:

  system.activationScripts.postActivation.text = lib.mkAfter ''
    if [[ -d "/Applications/Nix Trampolines" ]]; then
      chflags hidden "/Applications/Nix Trampolines"
    fi
  '';

Hiding the folder containing the trampolines in Finder by adding file
flag `hidden`.

Adding message about what's happening for when nix-darwin rebuilds the
system.
Moved nix-darwin module into separate file. Basic module is enabled by
default. Trampolines folder can be hidden in `/Applications/` folder
by setting option to `true`.
@christian-burger
Copy link
Contributor Author

Thanks. lib.mkAfter would work. And if you cannot merge my PR, I’d do either that or merge/rebase onto your changes as I am doing now. I’ve updated the PR: I made it configurable and nothing changes for people not explicitly activating the option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants