diff options
-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" ''; |