Skip to content

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

Open
christian-burger wants to merge 2 commits intohraban:masterfrom
christian-burger:hide-trampoline-folder
Open

nix-darwin: hide trampolines in /Applications, status message for darwin-rebuild#25
christian-burger wants to merge 2 commits intohraban:masterfrom
christian-burger:hide-trampoline-folder

Conversation

@christian-burger
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.
@christian-burger
Copy link
Copy Markdown
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.

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 christian-burger force-pushed the hide-trampoline-folder branch from e3a46ac to 3106513 Compare April 5, 2025 13:54
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