summaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..4d7e83a
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,35 @@
+{ compiler ? "default" }: let
+
+ stockholm = import <stockholm>;
+ inherit (stockholm.systems.${lib.krops.getHostName}) config pkgs;
+ inherit (stockholm) lib;
+
+ haskellPackages =
+ if compiler == "default"
+ then pkgs.haskellPackages
+ else pkgs.haskell.packages.${compiler};
+
+ drv = haskellPackages.callPackage (import ./.) {};
+
+in
+
+ lib.overrideDerivation drv.env (oldAttrs: {
+
+ buildInputs = [
+ pkgs.flameshot
+ ];
+
+ shellHook = ''
+ pkg_name=${lib.escapeShellArg (builtins.baseNameOf (toString ./.))}
+
+ WORKDIR=${lib.escapeShellArg (toString ./.)}
+ CACHEDIR=$HOME/tmp/$pkg_name
+ HISTFILE=$CACHEDIR/bash_history
+
+ mkdir -p "$CACHEDIR"
+
+ export SHELL=/run/current-system/sw/bin/bash
+
+ cd "$WORKDIR"
+ '';
+ })