pkgs: add writePerl{,Bin}

This commit is contained in:
2018-09-12 14:57:09 +02:00
parent 368a04fec3
commit 9cd634f650
3 changed files with 24 additions and 0 deletions

View File

@@ -313,6 +313,23 @@ pkgs: oldpkgs: {
${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out
'');
writePerl = name: { deps ? [] }:
let
perl-env = pkgs.buildEnv {
name = "perl-environment";
paths = deps;
pathsToLink = [
"/lib/perl5/site_perl"
];
};
in
pkgs.makeScriptWriter {
interpreter = "${pkgs.perl}/bin/perl -I ${perl-env}/lib/perl5/site_perl";
} name;
writePerlBin = name:
pkgs.writePerl "/bin/${name}";
writePython2 = name: { deps ? [], flakeIgnore ? [] }:
let
py = pkgs.python2.withPackages (ps: deps);