Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Last active August 2, 2018 23:45
Show Gist options
  • Save cleverca22/71ee5db254deb1e9469eeba0b037f90d to your computer and use it in GitHub Desktop.
Save cleverca22/71ee5db254deb1e9469eeba0b037f90d to your computer and use it in GitHub Desktop.
runHaskell
let
pkgs = import <nixpkgs> {};
runHaskell = name: deps: code: pkgs.runCommand name { buildInputs = [ (pkgs.haskellPackages.ghcWithPackages deps) ]; } ''
runhaskell ${pkgs.writeText "${name}.hs" code}
'';
in {
job1 = runHaskell "dummy" (ps: with ps; []) ''
import System.Environment
main = do
out <- getEnv "out"
writeFile out "test\n"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment