about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/profpatsch/default.nix13
-rw-r--r--pkgs/profpatsch/youtube2audiopodcast/default.nix12
2 files changed, 13 insertions, 12 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 {})
diff --git a/pkgs/profpatsch/youtube2audiopodcast/default.nix b/pkgs/profpatsch/youtube2audiopodcast/default.nix
index f0c9189d..6f3f85ec 100644
--- a/pkgs/profpatsch/youtube2audiopodcast/default.nix
+++ b/pkgs/profpatsch/youtube2audiopodcast/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, writeExecline, getBins, runInEmptyEnv, sandbox }:
+{ pkgs, lib, writeExecline, writeHaskellInterpret, getBins, runInEmptyEnv, sandbox }:
 
 let
   bins = getBins pkgs.hello [ "hello" ]
@@ -36,16 +36,6 @@ let
       "https://www.youtube.com/playlist?list=\${1}"
   ];
 
-  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;
-
   printFeed = writeHaskellInterpret "print-feed" {
     withPackages = hps: [ hps.feed hps.aeson ];
   } ./Main.hs;