rauhala.info/release.nix
2020-02-01 22:49:12 +02:00

45 lines
1.0 KiB
Nix

let
pin = builtins.fromJSON (builtins.readFile ./nixpkgs.json);
pinnedPkgs = with pin; import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
inherit sha256;
}) {};
in
{ pkgs ? pinnedPkgs }:
let
haskellPackages = pkgs.haskellPackages;
site = pkgs.callPackage ./default.nix {};
website = with pkgs; stdenv.mkDerivation {
pname = "rauhala.info";
version = "0.1.0";
src = lib.cleanSource ./.;
LANG = "en_US.UTF-8";
LOCALE_ARCHIVE = lib.optionalString stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
buildPhase = ''
${site}/bin/site clean
${site}/bin/site build
'';
installPhase = ''
mkdir -p $out/share/
mv _site $out/share/html
'';
};
shell = pkgs.buildEnv {
name = "site-shell";
paths = [];
buildInputs = [
haskellPackages.ghcid
haskellPackages.hasktags
(haskellPackages.ghcWithHoogle (h: site.buildInputs ++ site.propagatedBuildInputs))
];
};
in
{
inherit site shell website;
}