summaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-02-07 18:42:36 +0100
committertv <tv@krebsco.de>2019-02-07 18:54:59 +0100
commitfb5636483871fbafe9b286b377c339c8ddf8b4f8 (patch)
tree5016d6b38bff4b13856828ee385aaf7498d8e344 /shell.nix
initial commitv1.0.0-rc1
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"
+ '';
+ })