summaryrefslogtreecommitdiffstats
path: root/shell.nix
blob: 4d7e83a6e5dfba7c1385ed51d1a3f48d3feafe28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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"
    '';
  })