67 lines
1.7 KiB
Nix
67 lines
1.7 KiB
Nix
{
|
|
esbuild,
|
|
elmPackages,
|
|
haskellPackages,
|
|
lib,
|
|
stdenv,
|
|
...
|
|
}: let
|
|
ghcExeOptions = "-Wall -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N";
|
|
ghcPackages = p: [
|
|
p.aeson
|
|
p.blaze-html
|
|
p.blaze-markup
|
|
p.directory
|
|
p.elm-street
|
|
p.http-client
|
|
p.http-client-tls
|
|
p.http-types
|
|
p.scotty
|
|
p.text
|
|
p.wai-extra
|
|
p.warp
|
|
];
|
|
elmConfig = elmPackages.fetchElmDeps {
|
|
elmPackages = import ./src/elm2nix/elm-srcs.nix;
|
|
elmVersion = "0.19.1";
|
|
registryDat = ./src/elm2nix/registry.dat;
|
|
};
|
|
in
|
|
stdenv.mkDerivation {
|
|
pname = "elmskell";
|
|
version = "0.1.0";
|
|
src = ./src;
|
|
nativeBuildInputs = [
|
|
esbuild
|
|
(haskellPackages.ghcWithPackages ghcPackages)
|
|
elmPackages.elm
|
|
];
|
|
buildInputs = [
|
|
];
|
|
configurePhase = ''
|
|
${elmConfig}
|
|
'';
|
|
buildPhase = ''
|
|
ghc ${ghcExeOptions} ./ElmskellTypes.hs -o ./generateElmskellTypes
|
|
./generateElmskellTypes
|
|
elm make ./Main.elm --optimize --output=tmp.js
|
|
esbuild ./tmp.js --minify --target=es5 --outfile=main.js
|
|
ghc ${ghcExeOptions} ./Main.hs -o ./main
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp ./main $out/bin/elmskell
|
|
'';
|
|
|
|
meta = {
|
|
description = "Fully functional website template";
|
|
longDescription = ''
|
|
Elmskell is the hobby website of MTGmonkey. A running example is hosted at
|
|
mtgmonkey.net.
|
|
'';
|
|
homepage = "https://mtgmonkey.net";
|
|
license = lib.licenses.wtfpl;
|
|
mainProgram = "elmskell";
|
|
platforms = ["x86_64-linux"];
|
|
};
|
|
}
|