Skip to content

Optional Mac-friendly functionality for nix-env #1278

@copumpkin

Description

@copumpkin

This is just an idea, but I'm trying to think of how I'd want .app files to be managed by Nix, and I think this is it:

  1. Mac derivations contain by convention something like $out/Applications/MyApp.app
  2. Just the way nix-env manages ~/.nix-profile on all systems, on Darwin it should be somewhat aware of ~/Applications
  3. On macOS, every time it updates the user's profile, it looks for Applications in the profile's symlink tree, finds all top-level .app files (really folders) in there, and creates/updates macOS alias files for them in ~/Applications. These need to be macOS aliases because Spotlight (the macOS indexing system) doesn't index symlinks. I'm unsure if the aliases need to point to the underlying nix store paths or if they can point to the symlinks in the user's profile. This isn't ideal because it hurts the atomicity of environment updates a bit, but I don't think it'll be terrible

Any thoughts? It's not beautiful in part because ~/Applications doesn't "belong" to Nix (so other things could be in it), and in part because we can't use symlinks, but I think it would work quite nicely for a lot of things.

I see this as an alternate proposal to #956, which wants to completely own ~/Applications and assumes symlinks.

@edolstra @LnL7 @acowley @shlevy @domenkozar @mpscholten @matthewbauer

Metadata

Metadata

Assignees

Labels

featureFeature request or proposalmacosNix on macOS, aka OS X, aka darwin
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions