mirror of
https://github.com/danth/stylix
synced 2024-11-26 22:20:22 +00:00
939669577c
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.
38 lines
778 B
Nix
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; };
|
|
}
|