Thanks for the tips! 
The flox activate
hook strategy is brilliant… But indeed it doesn’t work with flatpak (or zed?).
Btw, I use fish, but I also tested with old bash and got the same results.
It seems the flox env variables do get pruned. Here is why I come to this conclusion:
flox activate -d rust_dev # envs are [rust_dev default], alright.
flatpak run dev.zed.Zed
# within zed, envs are [default]
env | grep _FLOX_ACTIVE_ENVIRONMENTS
_FLOX_ACTIVE_ENVIRONMENTS=[{"type":"dot-flox","path":"/home/pascalio/.flox","pointer":{"name":"default","version":1}}]
Now, if I comment out the .bashrc line for auto-activating flox:
- Well I have to activate them manually of course
- But then, within zed, there are no flox env variable at all, meaning they’ve been pruned.
# start bash then
flox activate
flox activate -d Applications/rust_dev
# flox [rust-dev default]
# confirmed by
env | grep _FLOX_ACTIVE_ENVIRONMENTS
# _FLOX_ACTIVE_ENVIRONMENTS=[{"type":"dot-flox","path":"/home/pascalio/Applications/rust_dev/.flox","pointer":{"name":"rust-dev","version":1}},{"type":"dot-flox","path":"/home/pascalio/.flox","pointer":{"name":"default","version":1}}]
flatpak run dev.zed.Zed
# Then within zed
env | grep _FLOX_ACTIVE_ENVIRONMENTS
# is empty (doesn't exist)
# and so are all flox variables as returned by
env | grep -i flox
# empty
# but if I then manually activate flox, then we get them of course.
So, zed doesn’t inherit the vars in flatpak. I should confirm with another flatpak to be sure it’s a flatpak thing.
Another point is:
- if I
flatpak run dev.zed.Zed
with my Applications/rust_dev
env activated, I get an error message from zed (or flatpak)
ERROR: ld.so: object '/nix/store/1l6if41nwjd92arvxn46jf1rkznqlq7i-ld-floxlib-1.0.0/lib/ld-floxlib.so' cannot be loaded as audit interface: cannot open shared object file; ignored. ERROR: ld.so: object '/nix/store/1l6if41nwjd92arvxn46jf1rkznqlq7i-ld-floxlib-1.0.0/lib/ld-floxlib.so' cannot be loaded as audit interface: cannot open shared object file; ignored. ERROR: ld.so: object '/nix/store/1l6if41nwjd92arvxn46jf1rkznqlq7i-ld-floxlib-1.0.0/lib/ld-floxlib.so' cannot be loaded as audit interface: cannot open shared object file; ignored. ERROR: ld.so: object '/nix/store/1l6if41nwjd92arvxn46jf1rkznqlq7i-ld-floxlib-1.0.0/lib/ld-floxlib.so' cannot be loaded as audit interface: cannot open shared object file; ignored.
- if I
flatpak run dev.zed.Zed
with just my default env activated, there is no error.
→ I don’t know if it’s any relevant since, there is no flox vars inherited in zed either way. But it’s maybe worth reporting…
Then, as to flox install zed-editor
, I tried it, but… zed just doesn’t start its GUI. It just sits idle in memory but does nothing. (on KDE, wayland…) I guess it’s a problem in the nix package. Other GUI apps install and run just fine with my flox.
Sorry for the lengthy message. Hope there is useful data in it!