From 6279ed68710de2dff2998dc6de3d877dd709fa2c Mon Sep 17 00:00:00 2001 From: James Conroy-Finn Date: Mon, 19 Feb 2024 14:15:12 +0000 Subject: [PATCH] jujutsu: remove shell completion Completion is installed by the jujutsu package itself, making this additional setup redundant. https://github.com/nix-community/home-manager/pull/5016#issuecomment-1947449541 https://github.com/nix-community/home-manager/pull/5037#pullrequestreview-1888843990 --- modules/programs/jujutsu.nix | 37 ++++++------------------------------ 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/modules/programs/jujutsu.nix b/modules/programs/jujutsu.nix index c511f2dcc..269c5ef93 100644 --- a/modules/programs/jujutsu.nix +++ b/modules/programs/jujutsu.nix @@ -10,6 +10,12 @@ let in { meta.maintainers = [ maintainers.shikanime ]; + imports = let + mkRemovedShellIntegration = name: + mkRemovedOptionModule [ "programs" "jujutsu" "enable${name}Integration" ] + "This option is no longer necessary."; + in map mkRemovedShellIntegration [ "Bash" "Fish" "Zsh" ]; + options.programs.jujutsu = { enable = mkEnableOption "a Git-compatible DVCS that is both simple and powerful"; @@ -33,24 +39,6 @@ in { for options. ''; }; - - enableBashIntegration = mkOption { - type = types.bool; - default = true; - description = "Whether to enable Bash integration."; - }; - - enableZshIntegration = mkOption { - type = types.bool; - default = true; - description = "Whether to enable Zsh integration."; - }; - - enableFishIntegration = mkOption { - type = types.bool; - default = true; - description = "Whether to enable Fish integration."; - }; }; config = mkIf cfg.enable { @@ -59,18 +47,5 @@ in { home.file.".jjconfig.toml" = mkIf (cfg.settings != { }) { source = tomlFormat.generate "jujutsu-config" cfg.settings; }; - - programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - source <(${pkgs.jujutsu}/bin/jj util completion) - ''; - - programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - source <(${pkgs.jujutsu}/bin/jj util completion --zsh) - compdef _jj ${pkgs.jujutsu}/bin/jj - ''; - - programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' - ${pkgs.jujutsu}/bin/jj util completion --fish | source - ''; }; }