nix: added release.nix

This commit is contained in:
Fiscal Velvet Poet 2021-11-03 12:15:15 +10:00
parent 360a233e67
commit 810349be92
Signed by: fiscalvelvetpoet
GPG key ID: D8EBFD58B023BD47

46
release.nix Normal file
View file

@ -0,0 +1,46 @@
let
sources = import ./nix/sources.nix;
in
{ compiler ? "ghc883"
, 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" ])
];
jfdic-web = hpNew.callCabal2nix "jfdic-web" ./. { };
niv = import sources.niv { };
};
};
project = haskellPackages.jfdic-web;
in
{
project = project;
shell = haskellPackages.shellFor {
packages = p: with p; [
project
];
#buildInputs = with haskellPackages; [
# ghcid
# hlint # or ormolu
# niv
# pkgs.cacert # needed for niv
# pkgs.nix # needed for niv
# zlib
#];
withHoogle = true;
};
}