mirror of
https://github.com/danth/stylix
synced 2024-11-22 12:13:08 +00:00
ba5565d698
Simplified a lot of code which was unnecessarily generic. Now using monads to manage the state of the random number generator rather than passing it around by hand. Also made some performance improvements, then increased the population size so more combinations are tried in a similar length of time.
39 lines
800 B
Nix
39 lines
800 B
Nix
{ haskellPackages, stdenvNoCC }:
|
|
|
|
let
|
|
ghc = haskellPackages.ghcWithPackages (ps: with ps; [
|
|
JuicyPixels
|
|
json
|
|
random
|
|
vector-algorithms
|
|
]);
|
|
|
|
# `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; };
|
|
}
|