broot: add xonsh integration

This commit is contained in:
paki23 2024-06-03 23:56:31 +02:00
parent 68a710b2e3
commit 242c89061d
No known key found for this signature in database
GPG key ID: 13160FFB4CEB03F2

View file

@ -167,6 +167,14 @@ in {
'';
};
enableXonshIntegration = mkOption {
default = true;
type = types.bool;
description = ''
Whether to enable Xonsh integration.
'';
};
enableFishIntegration = mkOption {
default = true;
type = types.bool;
@ -237,5 +245,27 @@ in {
programs.nushell.extraConfig =
mkIf cfg.enableNushellIntegration (shellInit "nushell");
programs.xonsh = mkIf cfg.enableXonshIntegration {
xonshrc = "xontrib load broot";
extraPackages = ps:
[
(ps.buildPythonPackage rec {
name = "xontrib-broot";
src = pkgs.fetchFromGitHub {
owner = "jnoortheen ";
repo = name;
rev = "6f658ff88aba27b921017297d8c2c3dfb2ffa332";
hash = "sha256-9GqsTVCMvrWpTopHtEdicTyYRQzP1NVtQHZsfBT+fUg=";
};
pyproject = true;
nativeBuildInputs = [ ps.setuptools ps.pdm-pep517 ];
postPatch = ''
substituteInPlace xontrib/broot.py --replace '"broot"' '"${cfg.package}/bin/broot"'
sed 's/dependencies = [[].*[]]//' < pyproject.toml > pyproject.toml
'';
})
];
};
};
}