1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00

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
This commit is contained in:
James Conroy-Finn 2024-02-19 14:15:12 +00:00 committed by Robert Helgesson
parent a54e05bc12
commit 517601b37c
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -10,6 +10,12 @@ let
in { in {
meta.maintainers = [ maintainers.shikanime ]; 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 = { options.programs.jujutsu = {
enable = enable =
mkEnableOption "a Git-compatible DVCS that is both simple and powerful"; mkEnableOption "a Git-compatible DVCS that is both simple and powerful";
@ -33,24 +39,6 @@ in {
for options. 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 { config = mkIf cfg.enable {
@ -59,18 +47,5 @@ in {
home.file.".jjconfig.toml" = mkIf (cfg.settings != { }) { home.file.".jjconfig.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "jujutsu-config" 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
'';
}; };
} }