-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.nix
58 lines (52 loc) · 1.46 KB
/
release.nix
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
let
sources = import ./nix/sources.nix;
in
{ compiler ? "ghc884"
, pkgs ? import sources.nixpkgs { }
}:
let
inherit (pkgs.lib.trivial) flip pipe;
inherit (pkgs.haskell.lib) appendPatch appendConfigureFlags;
haskellPackages = pkgs.haskell.packages.${compiler}.override {
overrides = hpNew: hpOld: {
hakyll =
pipe
hpOld.hakyll
[ (flip appendPatch ./hakyll.patch)
(flip appendConfigureFlags [ "-f" "watchServer" "-f" "previewServer" ])
];
# fix locale issue
# https://www.slamecka.cz/posts/2020-06-08-encoding-issues-with-nix-hakyll/
tylerbenster-com = (hpNew.callCabal2nix "tylerbenster-com" ./. { }).overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs or [] ++ [
pkgs.makeWrapper
];
postInstall = old.postInstall or "" + ''
wrapProgram $out/bin/site \
--set LANG "en_US.UTF-8" \
--set LOCALE_ARCHIVE "${pkgs.glibcLocales}/lib/locale/locale-archive"
'';
});
niv = import sources.niv { };
};
};
project = haskellPackages.tylerbenster-com;
in
{
project = project;
shell = haskellPackages.shellFor {
packages = p: with p; [
project
];
buildInputs = with haskellPackages; with pkgs; [
ghcid
hlint # or ormolu
niv
inotify-tools
nodejs-14_x
cacert # needed for niv
nix # needed for niv
];
withHoogle = true;
};
}