Open samuela opened 5 months ago
You can alias nix-shell
to nixGL nixVulkanIntel nix-shell
That's certainly an option, but what I'm ideally looking for is a solution to "install" nixGL in the currently running shell instead of spawning a new one.
That's certainly an option, but what I'm ideally looking for is a solution to "install" nixGL in the currently running shell instead of spawning a new one.
Lately Arch updated its gcc version and now that alias fails with these errors:
nix-shell: /nix/store/bn7pnigb0f8874m6riiw6dngsmdyic1g-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /usr/lib/libnixexpr.so)
nix-shell: /nix/store/bn7pnigb0f8874m6riiw6dngsmdyic1g-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /usr/lib/libnixmain.so)
nix-shell: /nix/store/bn7pnigb0f8874m6riiw6dngsmdyic1g-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /usr/lib/libnixstore.so)
nix-shell: /nix/store/bn7pnigb0f8874m6riiw6dngsmdyic1g-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /usr/lib/libnixutil.so)
So, I came up with a more "install" solution:
if [[ ! "$IN_NIX_SHELL" = "" ]] && [[ "$IN_NIXGL" = "" ]]; then
export IN_NIXGL=1
source <(
diff <(env) <(nixGL nixVulkanIntel env) \
| grep '>' | sed 's/^>/export/g'
)
fi
It extracts the environment variables that nixGL
and nixVulkanIntel
set, and adds them to the current shell.
It would be super handy to be able to "install" nixGL into a shell session such that I don't have to worry about wrapping each command in
nixGL foo ...
.Would maintainers be supportive of including such a feature?