home-manager
home-manager copied to clipboard
bug: fish: variables set in `home.sessionVariables` are overwritten by `/etc/profile`
Are you following the right branch?
- [X] My Nixpkgs and Home Manager versions are in sync
Is there an existing issue for this?
- [X] I have searched the existing issues
Issue description
I found an issue recently where $EDITOR
wasn't being set, despite me setting it in home.sessionVariables
. I tracked the issue down to the fact that /etc/profile
provides a default value, which is set to nano
by nixpkgs. When launching GNOME, /etc/profile
is sourced by GNOME's startup stack and the variable is brought into the global environment. My fish.config
ends up calling:
set -gx EDITOR "emacsclient"
But this ends up being ignored as the value sourced from /etc/profile
takes precedent. This means setting some sessionVariables
when using fish and GNOME will not work.
Maintainer CC
@octplane @Yure
System information
- system: `"x86_64-linux"`
- host os: `Linux 6.7.0, NixOS, 24.05 (Uakari), 24.05.20240108.317484b`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.19.2`
- channels(root): `"nixos"`
- nixpkgs: `/nix/store/wckjmzcqc347li9r9154nvav82f22g8n-0g53xyh39z3y90p4d8r341wbqyjy1zhl-source`
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.
If you are the original author of the issue
- If this is resolved, please consider closing it so that the maintainers know not to focus on this.
- If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
- If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
If you are not the original author of the issue
- If you are also experiencing this issue, please add details of your situation to help with the debugging process.
- If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Memorandum on closing issues
Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.
Workaround I used
https://nixos.wiki/wiki/Command_Shell#Changing_the_default_shell