Skip to content

Commit 6efd1a6

Browse files
committed
broot: add xonsh integration
1 parent 77dfbc5 commit 6efd1a6

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

modules/programs/broot.nix

+30
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ in {
167167
'';
168168
};
169169

170+
enableXonshIntegration = mkOption {
171+
default = true;
172+
type = types.bool;
173+
description = ''
174+
Whether to enable Xonsh integration.
175+
'';
176+
};
177+
170178
enableFishIntegration = mkOption {
171179
default = true;
172180
type = types.bool;
@@ -237,5 +245,27 @@ in {
237245

238246
programs.nushell.extraConfig =
239247
mkIf cfg.enableNushellIntegration (shellInit "nushell");
248+
249+
programs.xonsh = mkIf cfg.enableXonshIntegration {
250+
xonshrc = "xontrib load broot";
251+
extraPackages = ps:
252+
[
253+
(ps.buildPythonPackage rec {
254+
name = "xontrib-broot";
255+
src = pkgs.fetchFromGitHub {
256+
owner = "jnoortheen ";
257+
repo = name;
258+
rev = "6f658ff88aba27b921017297d8c2c3dfb2ffa332";
259+
hash = "sha256-9GqsTVCMvrWpTopHtEdicTyYRQzP1NVtQHZsfBT+fUg=";
260+
};
261+
pyproject = true;
262+
nativeBuildInputs = [ ps.setuptools ps.pdm-pep517 ];
263+
postPatch = ''
264+
substituteInPlace xontrib/broot.py --replace '"broot"' '"${cfg.package}/bin/broot"'
265+
sed 's/dependencies = [[].*[]]//' < pyproject.toml > pyproject.toml
266+
'';
267+
})
268+
];
269+
};
240270
};
241271
}

0 commit comments

Comments
 (0)