summaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
index 4d7e83a..d2e8d51 100644
--- a/shell.nix
+++ b/shell.nix
@@ -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"
'';