mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 02:42:59 +00:00
faae3de3d4
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.
25 lines
593 B
Nix
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
|
|
''
|