Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fish: Do not overwrite the inherited environment #25173

Closed
wants to merge 1 commit into from

Conversation

nagisa
Copy link
Contributor

@nagisa nagisa commented Apr 24, 2017

Motivation for this change

Previously fish would always set up the NixOS environment, shadowing the inherited environment. This meant that stuff like

nix-shell -p ... --run "fish"

as well as milder variants didn’t work at all.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@nagisa, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jgillich, @rnhmjoj and @Profpatsch to be potential reviewers.

fenv source ${config.system.build.setEnvironment} > /dev/null ^&1
fenv source /etc/fish/foreign-env/shellInit > /dev/null
if status --is-login
fenv source ${config.system.build.setEnvironment} > /dev/null ^&1
Copy link
Member

@Mic92 Mic92 Apr 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably break commands in non-interactive ssh sessions:

ssh foobar <command>

In /etc/profile we do instead:

if [ -n "$__ETC_PROFILE_SOURCED" ]; then return; fi                                                                                                                          
__ETC_PROFILE_SOURCED=1 

Something similar is probably preferred in fish.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. Updated.

Previously fish would always set up the NixOS environment, shadowing the inherited environment.
This meant that stuff like

    nix-shell -p ... --run "fish"

as well as milder variants didn’t work at all.
@jgillich
Copy link
Member

There is already #24314 for this.

@nagisa
Copy link
Contributor Author

nagisa commented Apr 24, 2017

No activity for a month. Good stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants