summaryrefslogtreecommitdiff
path: root/default.nix
blob: ec776eb3826d628460ca15ef869afd56ff033179 (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
36
{ pkgs ? (import <nixpkgs> {})
}:

with pkgs.lib;
    
let
  sourceFilter = path: type: ((hasSuffix ".hs" path) || (baseNameOf path == "src") || (baseNameOf path == "blog.cabal"));
in rec {
  haskellPackages = pkgs.haskellPackages.override {
    overrides = self : super : {
      hakyll = pkgs.haskell.lib.overrideCabal super.hakyll (drv: {
        doCheck = false;
      });
    };
  };
  dirty-haskell = pkgs.stdenv.lib.overrideDerivation (haskellPackages.callPackage ./blog.nix {})
    (attrs :
      { src = builtins.filterSource sourceFilter ./.;
        shellHook = ''
          export PROMPT_INFO=${attrs.name}
        '';
      }
    );
  texEnv = with pkgs; texlive.combine {
    inherit (texlive) scheme-small standalone dvisvgm amsmath tikz-cd rsfs;
  };
  dirty-haskell-wrapper = pkgs.stdenv.mkDerivation rec {
    name = "dirty-haskell-wrapper";
    buildInputs = [ pkgs.makeWrapper ];
    buildCommand = ''
      mkdir -p $out/bin
      makeWrapper ${dirty-haskell}/bin/site $out/bin/dirty-haskell \
        --prefix PATH : ${texEnv}/bin
    '';
  };
}