aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/default.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-09-12 14:57:09 +0200
committerlassulus <lassulus@lassul.us>2018-09-16 16:47:24 +0200
commit9cd634f650551080b01e06763c11836ce33e0613 (patch)
treec9e3b55ab4fbd3aa8a8811967f500b9025fd7ad4 /pkgs/default.nix
parent368a04fec30837037079d13c3704b9766af37eb8 (diff)
pkgs: add writePerl{,Bin}
Diffstat (limited to 'pkgs/default.nix')
-rw-r--r--pkgs/default.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 29457ca..b7b0dde 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -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);