diff options
author | Profpatsch <mail@profpatsch.de> | 2019-12-14 23:41:34 +0100 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2019-12-14 23:41:34 +0100 |
commit | d6752d574e67c8a091b04b6c98bb7b2957be13b3 (patch) | |
tree | 1f5191f0123910a93795c4593489fff534ce3cec /pkgs/profpatsch/default.nix | |
parent | 159ff74c75a1f31dcb183568efb21bf6d6f07a73 (diff) |
pkgs/profpatsch: move `writeHaskellInterpret` upwards
Diffstat (limited to 'pkgs/profpatsch/default.nix')
-rw-r--r-- | pkgs/profpatsch/default.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/profpatsch/default.nix b/pkgs/profpatsch/default.nix index f484c2ad..e246bd29 100644 --- a/pkgs/profpatsch/default.nix +++ b/pkgs/profpatsch/default.nix @@ -35,6 +35,17 @@ let bin = getBins pkgs.s6PortableUtils [ "s6-touch" "s6-echo" ]; }; + # TODO: upstream + writeHaskellInterpret = nameOrPath: { withPackages ? lib.const [] }: content: + let ghc = pkgs.haskellPackages.ghcWithPackages withPackages; in + pkgs.writers.makeScriptWriter { + interpreter = "${ghc}/bin/runhaskell"; + check = pkgs.writers.writeDash "ghc-typecheck" '' + ln -s "$1" ./Main.hs + ${ghc}/bin/ghc -fno-code -Wall ./Main.hs + ''; + } nameOrPath content; + runExeclineFns = # todo: factor out calling tests let @@ -101,7 +112,7 @@ in rec { inherit (pkgs.haskellPackages) ghcWithPackages; }; youtube2audiopodcast = callPackage ./youtube2audiopodcast { - inherit writeExecline getBins runInEmptyEnv sandbox; + inherit writeExecline writeHaskellInterpret getBins runInEmptyEnv sandbox; }; inherit (callPackage ./utils-hs {}) |