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:
- Mac derivations contain by convention something like
$out/Applications/MyApp.app
- Just the way
nix-env manages ~/.nix-profile on all systems, on Darwin it should be somewhat aware of ~/Applications
- 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
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:
$out/Applications/MyApp.appnix-envmanages~/.nix-profileon all systems, on Darwin it should be somewhat aware of~/ApplicationsApplicationsin the profile's symlink tree, finds all top-level.appfiles (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 terribleAny thoughts? It's not beautiful in part because
~/Applicationsdoesn'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
~/Applicationsand assumes symlinks.@edolstra @LnL7 @acowley @shlevy @domenkozar @mpscholten @matthewbauer