depot/third_party/nixpkgs/pkgs/shells/xonsh/wrapper.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

24 lines
465 B
Nix

{ runCommand
, xonsh-unwrapped
, lib
, extraPackages ? (ps: [ ])
}:
let
xonsh = xonsh-unwrapped;
inherit (xonsh.passthru) python;
pythonEnv = python.withPackages (ps: [
(ps.toPythonModule xonsh)
] ++ extraPackages ps);
in
runCommand "${xonsh.pname}-${xonsh.version}"
{
inherit (xonsh) pname version meta passthru;
} ''
mkdir -p $out/bin
for bin in ${lib.getBin xonsh}/bin/*; do
ln -s ${pythonEnv}/bin/$(basename "$bin") $out/bin/
done
''