-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrelease.nix
54 lines (46 loc) · 1.26 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
let
defaultSources = import ./nix/sources.nix;
defaultNixpkgs = import defaultSources.nixpkgs {};
in
{ sources ? import ./nix/sources.nix }:
let
pkgs = import sources.nixpkgs {};
default = import ./default.nix { pkgs = pkgs; };
haskellPackages = default.haskellPackages;
in rec {
siteGen = pkgs.haskell.lib.overrideCabal default.site (drv: {
inherit (default) src;
postPatch = (drv.postPatch or "") + ''
find
sed -i \
-e "/unixFilter .*css.*/ s!css!$out/bin/css!" \
curry-site.hs
'';
});
hoogleEnv = haskellPackages.ghcWithHoogle (_: [ siteGen ]);
site = pkgs.stdenv.mkDerivation {
name = "curry-club-augsburg.de";
inherit (default) src;
buildInputs = [
pkgs.glibcLocales
(haskellPackages.ghcWithPackages (hp: [ hp.cabal-install ]))
siteGen
];
buildPhase = ''
env LANG=de_DE.UTF-8 \
backend=inpath \
HOME=$(mktemp -d) \
curry-site build
'';
installPhase = ''
mv _site "$out"
mkdir -p "$out/nix-support"
echo "website website $out/index.html" \
> "$out/nix-support/hydra-build-products"
'';
doCheck = true;
checkPhase = ''
env LANG=de_DE.UTF-8 curry-site check --internal-links
'';
};
}