diff options
author | tv <tv@krebsco.de> | 2020-05-01 01:33:13 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2020-05-01 01:33:13 +0200 |
commit | f0e8d1b9041662ec07eae33d3c03109e2abcf6e8 (patch) | |
tree | b5e88ff4926c75b11cda88e1cf354e550e60050c | |
parent | cebaefa37095e74ad2253c4e2f9d9ab390f88737 (diff) |
shell.nix: add build and run
-rw-r--r-- | shell.nix | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -28,7 +28,28 @@ in mkdir -p "$CACHEDIR" + exe=$CACHEDIR/${lib.currentSystem} + + build() {( + set -efu + cd "$WORKDIR" + options=$( + ${pkgs.cabal-read}/bin/ghc-options "$pkg_name.cabal" "$pkg_name" + ) + exec ghc $options \ + -isrc \ + -odir "$CACHEDIR" \ + -hidir "$CACHEDIR" \ + -o "$exe" \ + src/main.hs + )} + + run() {( + exec "$exe" "$@" + )} + export SHELL=/run/current-system/sw/bin/bash + export FLAMESHOT_CAPTURE_PATH="$CACHEDIR/captures" cd "$WORKDIR" ''; |