diff options
author | tv <tv@krebsco.de> | 2018-01-02 20:58:59 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-01-02 20:58:59 +0100 |
commit | 493984d97e6deaee3d7b358724e83c59bccb212d (patch) | |
tree | 691e019ae0b55d48a9681d9c26ae65e6c83d1d0f /krebs/5pkgs/writers.nix | |
parent | 84fdbeba2ceee152a128f5e9013043c172c07ecf (diff) | |
parent | e48b4eb4606f6d0ec0b930016a53e7e7cfcbfb64 (diff) |
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/5pkgs/writers.nix')
-rw-r--r-- | krebs/5pkgs/writers.nix | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/krebs/5pkgs/writers.nix b/krebs/5pkgs/writers.nix index 6e67ed699..a48fc0f87 100644 --- a/krebs/5pkgs/writers.nix +++ b/krebs/5pkgs/writers.nix @@ -283,27 +283,33 @@ with import <stockholm/lib>; ${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out ''); - writePython2 = name: text: - assert (with types; either absolute-pathname filename).check name; - pkgs.writeOut (baseNameOf name) { - ${optionalString (types.absolute-pathname.check name) name} = { - check = pkgs.writeDash "python2check.sh" '' - exec ${pkgs.python2}/bin/python -m py_compile "$1" - ''; - inherit text; - }; - }; + writePython2 = deps: + let + py = pkgs.python2.withPackages(ps: attrVals deps ps); + in + pkgs.makeScriptWriter { + interpreter = "${py}/bin/python"; + check = pkgs.writeDash "python2check.sh" '' + exec ${pkgs.python2Packages.flake8}/bin/flake8 --show-source "$1" + ''; + }; - writePython3 = name: text: - assert (with types; either absolute-pathname filename).check name; - pkgs.writeOut (baseNameOf name) { - ${optionalString (types.absolute-pathname.check name) name} = { - check = pkgs.writeDash "python3check.sh" '' - exec ${pkgs.python3}/bin/python -m py_compile "$textPath" - ''; - inherit text; - }; - }; + writePython2Bin = d: name: + pkgs.writePython2 d "/bin/${name}"; + + writePython3 = deps: + let + py = pkgs.python3.withPackages(ps: attrVals deps ps); + in + pkgs.makeScriptWriter { + interpreter = "${py}/bin/python"; + check = pkgs.writeDash "python3check.sh" '' + exec ${pkgs.python3Packages.flake8}/bin/flake8 --show-source "$1" + ''; + }; + + writePython3Bin = d: name: + pkgs.writePython3 d "/bin/${name}"; writeSed = pkgs.makeScriptWriter { interpreter = "${pkgs.gnused}/bin/sed -f"; |