nixpkgs/pkgs/by-name/xo/xonsh/package.nix
Jade Lovelace faae3de3d4 xonsh: expose unwrapped
Currently it is impossible to import xonsh into python for e.g. language
servers to be able to get completion for it, or otherwise treat it as a
python lib. We aren't sure why the unwrapped derivation was made
inaccessible, but it's definitely a problem.
2024-06-05 21:19:25 -07:00

25 lines
593 B
Nix

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