···104104 environment.etc."fish/foreign-env/interactiveShellInit".text = cfge.interactiveShellInit;
105105106106 environment.etc."fish/nixos-env-preinit.fish".text = ''
107107- # avoid clobbering the environment if it's been set by a parent shell
108108-109107 # This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently
110108 # unset. We set it and then completely erase it, leaving its configuration to $__fish_datadir/config.fish
111109 set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $__fish_datadir/functions
···120118 environment.etc."fish/config.fish".text = ''
121119 # /etc/fish/config.fish: DO NOT EDIT -- this file has been generated automatically.
122120123123- # if our parent shell didn't source the general config, do it
121121+ # if we haven't sourced the general config, do it
124122 if not set -q __fish_nixos_general_config_sourced
125123 set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $fish_function_path
126124 fenv source /etc/fish/foreign-env/shellInit > /dev/null
···128126129127 ${cfg.shellInit}
130128131131- # and leave a note to our children to spare them the same work
132132- set -gx __fish_nixos_general_config_sourced 1
129129+ # and leave a note so we don't source this config section again from
130130+ # this very shell (children will source the general config anew)
131131+ set -g __fish_nixos_general_config_sourced 1
133132 end
134133135135- # if our parent shell didn't source the login config, do it
134134+ # if we haven't sourced the login config, do it
136135 status --is-login; and not set -q __fish_nixos_login_config_sourced
137136 and begin
138137 set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $fish_function_path
···141140142141 ${cfg.loginShellInit}
143142144144- # and leave a note to our children to spare them the same work
145145- set -gx __fish_nixos_login_config_sourced 1
143143+ # and leave a note so we don't source this config section again from
144144+ # this very shell (children will source the general config anew)
145145+ set -g __fish_nixos_login_config_sourced 1
146146 end
147147148148- # if our parent shell didn't source the interactive config, do it
148148+ # if we haven't sourced the interactive config, do it
149149 status --is-interactive; and not set -q __fish_nixos_interactive_config_sourced
150150 and begin
151151 ${fishAliases}
···158158 ${cfg.promptInit}
159159 ${cfg.interactiveShellInit}
160160161161- # and leave a note to our children to spare them the same work
162162- set -gx __fish_nixos_interactive_config_sourced 1
161161+ # and leave a note so we don't source this config section again from
162162+ # this very shell (children will source the general config anew,
163163+ # allowing configuration changes in, e.g, aliases, to propagate)
164164+ set -g __fish_nixos_interactive_config_sourced 1
163165 end
164166 '';
165167