Skip to content

Commit bb3577f

Browse files
nixos/xonsh: add bash completions support (NixOS#386311)
2 parents b4c253e + 04a0fa8 commit bb3577f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

nixos/modules/programs/xonsh.nix

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ let
66

77
cfg = config.programs.xonsh;
88
package = cfg.package.override { inherit (cfg) extraPackages; };
9+
bashCompletionPath = "${cfg.bashCompletion.package}/share/bash-completion/bash_completion";
910
in
1011

1112
{
@@ -49,6 +50,13 @@ in
4950
Xontribs and extra Python packages to be available in xonsh.
5051
'';
5152
};
53+
54+
bashCompletion = {
55+
enable = lib.mkEnableOption "bash completions for xonsh" // {
56+
default = true;
57+
};
58+
package = lib.mkPackageOption pkgs "bash-completion" { };
59+
};
5260
};
5361

5462
};
@@ -78,6 +86,8 @@ in
7886
aliases['ls'] = _ls_alias
7987
del _ls_alias
8088
89+
${lib.optionalString cfg.bashCompletion.enable "$BASH_COMPLETIONS = '${bashCompletionPath}'"}
90+
8191
${cfg.config}
8292
'';
8393

0 commit comments

Comments
 (0)