diff --git a/nixos/modules/programs/xonsh.nix b/nixos/modules/programs/xonsh.nix index 3fcb32db4830..8febb718e1d8 100644 --- a/nixos/modules/programs/xonsh.nix +++ b/nixos/modules/programs/xonsh.nix @@ -6,6 +6,7 @@ let cfg = config.programs.xonsh; package = cfg.package.override { inherit (cfg) extraPackages; }; + bashCompletionPath = "${cfg.bashCompletion.package}/share/bash-completion/bash_completion"; in { @@ -49,6 +50,13 @@ in Xontribs and extra Python packages to be available in xonsh. ''; }; + + bashCompletion = { + enable = lib.mkEnableOption "bash completions for xonsh" // { + default = true; + }; + package = lib.mkPackageOption pkgs "bash-completion" { }; + }; }; }; @@ -78,6 +86,8 @@ in aliases['ls'] = _ls_alias del _ls_alias + ${lib.optionalString cfg.bashCompletion.enable "$BASH_COMPLETIONS = '${bashCompletionPath}'"} + ${cfg.config} '';