diff options
author | tv <tv@krebsco.de> | 2018-09-25 20:38:14 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-09-25 20:38:14 +0200 |
commit | 0660cc1a1169e799bda356c6fadb245a96345816 (patch) | |
tree | 74e5443bd152333b50c2d5619926eb31b69513ec /pkgs | |
parent | c27a9416e8ee04d708b11b48f8cf1a055c0cc079 (diff) | |
parent | 79ab2c27f9d7903ff3ed9bcd8de493b1191bbc12 (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/default.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix index a5582f3..ea3421b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -303,6 +303,23 @@ pkgs: oldpkgs: { }; }; + writeJS = name: { deps ? [] }: text: + let + node-env = pkgs.buildEnv { + name = "node"; + paths = deps; + pathsToLink = [ + "/lib/node_modules" + ]; + }; + in pkgs.writeDash name '' + export NODE_PATH=${node-env}/lib/node_modules + exec ${pkgs.nodejs}/bin/node ${pkgs.writeText "js" text} + ''; + + writeJSBin = name: + pkgs.writeJS "/bin/${name}"; + writeJSON = name: value: pkgs.runCommand name { json = toJSON value; passAsFile = [ "json" ]; @@ -319,6 +336,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); |