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.

Sorry, something went wrong.

@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.

@nagisa nagisa force-pushed the fish-env-overwrite branch from 82936d8 to ee48904 Compare April 24, 2017 10:15
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.

@nagisa nagisa force-pushed the fish-env-overwrite branch from ee48904 to 99d49b8 Compare April 24, 2017 10:50
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.
@nagisa nagisa force-pushed the fish-env-overwrite branch from 99d49b8 to 331de85 Compare April 24, 2017 10:52
@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.

@nagisa nagisa closed this Apr 24, 2017
@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants