1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-31 04:04:32 +00:00

treewide: zsh initExtra -> initContent

Migrating in tree usages of zsh initExtra to initContent before
deprecating.
This commit is contained in:
Austin Horstman 2025-03-19 15:43:42 -05:00
parent 296ddc6462
commit 10deb9d043
39 changed files with 59 additions and 57 deletions

View file

@ -45,7 +45,7 @@
})
(lib.mkIf config.programs.zsh.enableVteIntegration {
programs.zsh.initExtra = ''
programs.zsh.initContent = ''
. ${pkgs.vte}/etc/profile.d/vte.sh
'';
})

View file

@ -114,7 +114,7 @@ in {
fi
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
if [[ $options[zle] = on ]]; then
eval "$(${lib.getExe cfg.package} init zsh ${flagsStr})"
fi

View file

@ -30,7 +30,7 @@ in {
. ${package}/share/autojump/autojump.bash
'');
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
. ${package}/share/autojump/autojump.zsh
'';

View file

@ -214,7 +214,7 @@ in {
programs.bash.initExtra = mkIf cfg.enableBashIntegration (shellInit "bash");
programs.zsh.initExtra = mkIf cfg.enableZshIntegration (shellInit "zsh");
programs.zsh.initContent = mkIf cfg.enableZshIntegration (shellInit "zsh");
programs.fish.shellInit = mkIf cfg.enableFishIntegration (shellInit "fish");

View file

@ -37,7 +37,7 @@ in {
source <(${bin} _carapace bash)
'';
zsh.initExtra = mkIf cfg.enableZshIntegration ''
zsh.initContent = mkIf cfg.enableZshIntegration ''
source <(${bin} _carapace zsh)
'';

View file

@ -47,7 +47,7 @@ in {
config = mkIf cfg.enable {
programs.bash.initExtra = shInit "command_not_found_handle";
programs.zsh.initExtra = shInit "command_not_found_handler";
programs.zsh.initContent = shInit "command_not_found_handler";
home.packages = [ commandNotFound ];
};

View file

@ -121,7 +121,7 @@ in {
eval "$(${getExe cfg.package} hook bash)"
'');
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${getExe cfg.package} hook zsh)"
'';

View file

@ -54,7 +54,7 @@ in {
fi
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
if [[ $TERM != "dumb" ]]; then
eval "$(${ewwCmd} shell-completions --shell zsh)"
fi

View file

@ -195,7 +195,7 @@ in {
# Note, since fzf unconditionally binds C-r we use `mkOrder` to make the
# initialization show up a bit earlier. This is to make initialization of
# other history managers, like mcfly or atuin, take precedence.
programs.zsh.initExtra =
programs.zsh.initContent =
mkIf cfg.enableZshIntegration (mkOrder 200 zshIntegration);
programs.fish.interactiveShellInit =

View file

@ -194,7 +194,7 @@ in {
})
(lib.mkIf cfg.enableZshIntegration {
programs.zsh.initExtra = ''
programs.zsh.initContent = ''
if [[ -n $GHOSTTY_RESOURCES_DIR ]]; then
source "$GHOSTTY_RESOURCES_DIR"/shell-integration/zsh/ghostty-integration
fi

View file

@ -33,7 +33,7 @@ in {
optionalString cfg.enableBashIntegration (initScript "bash");
programs.fish.interactiveShellInit =
optionalString cfg.enableFishIntegration (initScript "fish");
programs.zsh.initExtra =
programs.zsh.initContent =
optionalString cfg.enableZshIntegration (initScript "zsh");
};
}

View file

@ -23,7 +23,7 @@ in {
config = mkIf cfg.enable {
home.packages = [ package ];
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
function assume() {
export GRANTED_ALIAS_CONFIGURED="true"
source ${package}/bin/assume "$@"

View file

@ -30,7 +30,7 @@ in {
eval "$(${cfg.package}/bin/hstr --show-configuration)"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/hstr --show-zsh-configuration)"
'';
};

View file

@ -93,7 +93,7 @@ in {
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
SHELL=fish eval (${shellCommand})
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(SHELL=zsh ${shellCommand})"
'';
programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration ''

View file

@ -282,7 +282,7 @@ in {
programs.fish.interactiveShellInit =
mkIf cfg.shellIntegration.enableFishIntegration shellIntegrationInit.fish;
programs.zsh.initExtra =
programs.zsh.initContent =
mkIf cfg.shellIntegration.enableZshIntegration shellIntegrationInit.zsh;
};
}

View file

@ -141,7 +141,7 @@ in {
programs.bash.initExtra = mkIf cfg.enableBashIntegration bashIntegration;
programs.zsh.initExtra = mkIf cfg.enableZshIntegration zshIntegration;
programs.zsh.initContent = mkIf cfg.enableZshIntegration zshIntegration;
programs.fish.shellInit = mkIf cfg.enableFishIntegration fishIntegration;

View file

@ -108,7 +108,7 @@ in {
eval "$(${getExe cfg.package} activate bash)"
'';
zsh.initExtra = mkIf cfg.enableZshIntegration ''
zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${getExe cfg.package} activate zsh)"
'';

View file

@ -65,7 +65,7 @@ in {
source <(${cfg.package}/bin/mods completion bash)
'');
programs.zsh.initExtra = mkIf cfg.enableZshIntegration (mkOrder 200 ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration (mkOrder 200 ''
source <(${cfg.package}/bin/mods completion zsh)
'');

View file

@ -66,7 +66,7 @@ in {
fi
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
if [[ $options[zle] = on ]]; then
eval "$(${cfg.package}/bin/navi widget zsh)"
fi

View file

@ -41,7 +41,7 @@ in {
source ${cfg.package}/etc/profile.d/command-not-found.sh
'';
programs.zsh.initExtra = lib.mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = lib.mkIf cfg.enableZshIntegration ''
source ${cfg.package}/etc/profile.d/command-not-found.sh
'';

View file

@ -45,7 +45,7 @@ in {
'';
};
zsh.initExtra = mkIf cfg.enableZshIntegration ''
zsh.initContent = mkIf cfg.enableZshIntegration ''
${cfg.package}/bin/nix-your-shell zsh | source /dev/stdin
'';
};

View file

@ -71,7 +71,7 @@ in {
eval "$(${cfg.package}/bin/oh-my-posh init bash ${configArgument})"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/oh-my-posh init zsh ${configArgument})"
'';

View file

@ -36,7 +36,7 @@ in {
eval "$(${cfg.package}/bin/opam env --shell=bash)"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/opam env --shell=zsh)"
'';

View file

@ -35,7 +35,7 @@ in {
''}
'';
zsh.initExtra = ''
zsh.initContent = ''
${optionalString cfg.enableZshIntegration ''
eval "$(${payRespectsCmd} zsh --alias)"
''}

View file

@ -29,7 +29,7 @@ in {
eval "$(${pkgs.pazi}/bin/pazi init bash)"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${pkgs.pazi}/bin/pazi init zsh)"
'';

View file

@ -142,27 +142,28 @@ in {
fi
'';
programs.zsh.initExtra = mkIf (cfg.enable && config.programs.zsh.enable) ''
function powerline_precmd() {
${
if evalMode then "eval " else "PS1="
}"$(${pkgs.powerline-go}/bin/powerline-go -error $? -shell zsh${commandLineArguments})"
${cfg.extraUpdatePS1}
}
programs.zsh.initContent =
mkIf (cfg.enable && config.programs.zsh.enable) ''
function powerline_precmd() {
${
if evalMode then "eval " else "PS1="
}"$(${pkgs.powerline-go}/bin/powerline-go -error $? -shell zsh${commandLineArguments})"
${cfg.extraUpdatePS1}
}
function install_powerline_precmd() {
for s in "$\{precmd_functions[@]}"; do
if [ "$s" = "powerline_precmd" ]; then
return
fi
done
precmd_functions+=(powerline_precmd)
}
function install_powerline_precmd() {
for s in "$\{precmd_functions[@]}"; do
if [ "$s" = "powerline_precmd" ]; then
return
fi
done
precmd_functions+=(powerline_precmd)
}
if [ "$TERM" != "linux" ]; then
install_powerline_precmd
fi
'';
if [ "$TERM" != "linux" ]; then
install_powerline_precmd
fi
'';
# https://github.com/justjanne/powerline-go#fish
programs.fish.interactiveShellInit =

View file

@ -54,7 +54,7 @@ in {
eval "$(${lib.getExe cfg.package} init - bash)"
'';
programs.zsh.initExtra = lib.mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = lib.mkIf cfg.enableZshIntegration ''
export PYENV_ROOT="${cfg.rootDirectory}"
eval "$(${lib.getExe cfg.package} init - zsh)"
'';

View file

@ -11,7 +11,7 @@ in {
home.packages = [ pkgs.pywal ];
programs.zsh.initExtra = ''
programs.zsh.initContent = ''
# Import colorscheme from 'wal' asynchronously
# & # Run the process in the background.
# ( ) # Hide shell job control messages.

View file

@ -79,7 +79,7 @@ in {
eval "$(${cfg.package}/bin/rbenv init - bash)"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/rbenv init - zsh)"
'';

View file

@ -45,7 +45,7 @@ in {
eval "$(${cfg.package}/bin/scmpuff init ${mkArgs "bash"})"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${cfg.package}/bin/scmpuff init ${mkArgs "zsh"})"
'';

View file

@ -114,7 +114,7 @@ in {
fi
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
if [[ $options[zle] = on ]]; then
. ${cfg.package}/share/skim/completion.zsh
. ${cfg.package}/share/skim/key-bindings.zsh

View file

@ -106,7 +106,7 @@ in {
fi
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
if [[ $TERM != "dumb" ]]; then
eval "$(${starshipCmd} init zsh)"
fi

View file

@ -57,7 +57,7 @@ with lib;
};
};
programs.zsh.initExtra = mkIf cfg.enableZshIntegration shEvalCmd;
programs.zsh.initContent = mkIf cfg.enableZshIntegration shEvalCmd;
programs.nushell = mkIf cfg.enableNushellIntegration {
extraConfig = ''

View file

@ -80,7 +80,7 @@ in {
source ${cfg.package}/share/bash-completion/completions/watson
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
source ${cfg.package}/share/zsh/site-functions/_watson
'';

View file

@ -108,6 +108,7 @@ in {
programs.bash.initExtra =
mkIf cfg.enableBashIntegration shellIntegrationStr;
programs.zsh.initExtra = mkIf cfg.enableZshIntegration shellIntegrationStr;
programs.zsh.initContent =
mkIf cfg.enableZshIntegration shellIntegrationStr;
};
}

View file

@ -196,7 +196,7 @@ in {
in {
bash.initExtra = mkIf cfg.enableBashIntegration bashIntegration;
zsh.initExtra = mkIf cfg.enableZshIntegration bashIntegration;
zsh.initContent = mkIf cfg.enableZshIntegration bashIntegration;
fish.functions.${cfg.shellWrapperName} =
mkIf cfg.enableFishIntegration fishIntegration;

View file

@ -56,7 +56,7 @@ in {
})"
'';
programs.zsh.initExtra = mkIf cfg.enableZshIntegration ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
eval "$(${pkgs.z-lua}/bin/z --init zsh ${
concatStringsSep " " cfg.options
})"

View file

@ -73,7 +73,7 @@ in {
eval "$(${zellijCmd} setup --generate-auto-start bash)"
'');
programs.zsh.initExtra = mkIf cfg.enableZshIntegration (mkOrder 200 ''
programs.zsh.initContent = mkIf cfg.enableZshIntegration (mkOrder 200 ''
eval "$(${zellijCmd} setup --generate-auto-start zsh)"
'');

View file

@ -300,7 +300,7 @@ in {
'';
programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr;
programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgZshInitStr;
programs.zsh.initContent = mkIf cfg.enableZshIntegration gpgZshInitStr;
programs.fish.interactiveShellInit =
mkIf cfg.enableFishIntegration gpgFishInitStr;