1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

fish: simplify config guards

This commit is contained in:
Kid 2021-08-09 13:27:58 +08:00 committed by GitHub
parent 007d700e64
commit 0a5547e3c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,43 +187,27 @@ in
etc."fish/config.fish".text = ''
# /etc/fish/config.fish: DO NOT EDIT -- this file has been generated automatically.
# if we haven't sourced the general config, do it
if not set -q __fish_nix_darwin_general_config_sourced
${sourceEnv "shellInit"}
# Only execute this file once per shell.
set -q __fish_nix_darwin_config_sourced; and exit
set -g __fish_nix_darwin_config_sourced 1
${cfg.shellInit}
${sourceEnv "shellInit"}
# and leave a note so we don't source this config section again from
# this very shell (children will source the general config anew)
set -g __fish_nix_darwin_general_config_sourced 1
end
${cfg.shellInit}
# if we haven't sourced the login config, do it
status --is-login; and not set -q __fish_nix_darwin_login_config_sourced
and begin
status --is-login; and begin
${sourceEnv "loginShellInit"}
${cfg.loginShellInit}
# and leave a note so we don't source this config section again from
# this very shell (children will source the general config anew)
set -g __fish_nix_darwin_login_config_sourced 1
end
# if we haven't sourced the interactive config, do it
status --is-interactive; and not set -q __fish_nix_darwin_interactive_config_sourced
and begin
status --is-interactive; and begin
${fishAliases}
${sourceEnv "interactiveShellInit"}
${cfg.promptInit}
${cfg.interactiveShellInit}
# and leave a note so we don't source this config section again from
# this very shell (children will source the general config anew,
# allowing configuration changes in, e.g, aliases, to propagate)
set -g __fish_nix_darwin_interactive_config_sourced 1
end
'';
}