stylix/palette-generator/default.nix
Daniel Thwaites 939669577c
Remove Haddock pages from website 📝
This was more of a developer tool than part of the documentation, so it
makes sense to keep it off the main site. Also when modifying the
palette generator, the documentation on the site would become out of
sync with local changes anyway.
2023-02-13 20:09:56 +00:00

38 lines
778 B
Nix

{ haskellPackages, stdenvNoCC }:
let
ghc = haskellPackages.ghcWithPackages (ps: with ps; [
JuicyPixels
json
random
]);
# `nix build .#palette-generator.passthru.docs` and open in a web browser
docs = stdenvNoCC.mkDerivation {
name = "palette-generator-haddock";
src = ./.;
buildInputs = [ ghc ];
buildPhase = ''
haddock $src/**/*.hs --html --ignore-all-exports --odir $out
'';
dontInstall = true;
dontFixup = true;
};
in stdenvNoCC.mkDerivation {
name = "palette-generator";
src = ./.;
buildInputs = [ ghc ];
buildPhase = ''
ghc -O -threaded -Wall -Wno-type-defaults Stylix/Main.hs
'';
installPhase = ''
install -D Stylix/Main $out/bin/palette-generator
'';
passthru = { inherit docs; };
}