From 9282dbc1fa69eee22086920d24fec7588bd5c160 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Thu, 28 Oct 2021 06:40:39 +0800 Subject: [PATCH] fish: remove `promptInit` in favor of `interactiveShellInit` (#2231) * fish: remove `promptInit` in favor of `interactiveShellInit` * Oops * starship: replace `promptInit` with `interactiveShellInit` * autojump: replace `promptInit` with `interactiveShellInit` * Add `mkRemovedOptionModule` for `programs.fish.promptInit` --- modules/programs/autojump.nix | 2 +- modules/programs/fish.nix | 21 ++++++++++----------- modules/programs/starship.nix | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/modules/programs/autojump.nix b/modules/programs/autojump.nix index db3bdaf59..e8bf6b437 100644 --- a/modules/programs/autojump.nix +++ b/modules/programs/autojump.nix @@ -49,7 +49,7 @@ in { . ${package}/share/autojump/autojump.zsh ''; - programs.fish.promptInit = mkIf cfg.enableFishIntegration '' + programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' . ${package}/share/autojump/autojump.fish ''; }; diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 8ae2b0112..0387df799 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -146,6 +146,16 @@ let (mapAttrsToList (k: v: "alias ${k} ${escapeShellArg v}") cfg.shellAliases); in { + imports = [ + (mkRemovedOptionModule [ "programs" "fish" "promptInit" ] '' + Prompt is now configured through the + + programs.fish.interactiveShellInit + + option. Please change to use that instead. + '') + ]; + options = { programs.fish = { enable = mkEnableOption "fish, the friendly interactive shell"; @@ -214,14 +224,6 @@ in { initialisation. ''; }; - - promptInit = mkOption { - type = types.lines; - default = ""; - description = '' - Shell script code used to initialise fish prompt. - ''; - }; }; programs.fish.plugins = mkOption { @@ -365,9 +367,6 @@ in { # Aliases ${aliasesStr} - # Prompt initialisation - ${cfg.promptInit} - # Interactive shell intialisation ${cfg.interactiveShellInit} diff --git a/modules/programs/starship.nix b/modules/programs/starship.nix index c90f69c44..77a9cad31 100644 --- a/modules/programs/starship.nix +++ b/modules/programs/starship.nix @@ -102,7 +102,7 @@ in { fi ''; - programs.fish.promptInit = mkIf cfg.enableFishIntegration '' + programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' if test "$TERM" != "dumb" -a \( -z "$INSIDE_EMACS" -o "$INSIDE_EMACS" = "vterm" \) eval (${starshipCmd} init fish) end