aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-06-17 22:10:56 +0200
committerlassulus <lassulus@lassul.us>2018-06-18 15:24:41 +0200
commit4d0829328e885a6d7163b513998a975e60dd0a72 (patch)
tree6cd60e48e628e545af1a8232f2639ad2f89ae3a7 /pkgs
parent0f52d5461ad1bf54c2562734830276fc732c01cf (diff)
pkgs: add writeHaskell
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/default.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 6e8b06f..c01f88c 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -155,6 +155,21 @@ pkgs: oldpkgs: {
mv "$textPath" $out
'';
+ writeHaskell = name: extra-deps: text:
+ pkgs.stdenv.mkDerivation {
+ inherit name;
+ src = pkgs.writeHaskellPackage name {
+ executables.${name} = {
+ inherit extra-deps;
+ text = text;
+ };
+ };
+ phases = [ "buildPhase" ];
+ buildPhase = ''
+ ln -fns $src/bin/${name} $out
+ '';
+ };
+
writeHaskellPackage =
k:
let