nixify, README, license
This commit is contained in:
parent
b929e21f82
commit
0a00070dbb
33 changed files with 62 additions and 2112 deletions
26
package.nix
26
package.nix
|
@ -2,10 +2,11 @@
|
|||
esbuild,
|
||||
elmPackages,
|
||||
haskellPackages,
|
||||
lib,
|
||||
stdenv,
|
||||
...
|
||||
}: let
|
||||
ghcExeOptions = "-Wall -Wcompact -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N";
|
||||
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
|
||||
|
@ -19,9 +20,9 @@
|
|||
p.warp
|
||||
];
|
||||
elmConfig = elmPackages.fetchElmDeps {
|
||||
elmPackages = import ./frontend/elm-srcs.nix;
|
||||
elmPackages = import ./src/elm2nix/elm-srcs.nix;
|
||||
elmVersion = "0.19.1";
|
||||
registryDat = ./frontend/registry.dat;
|
||||
registryDat = ./src/elm2nix/registry.dat;
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
|
@ -39,15 +40,26 @@ in
|
|||
${elmConfig}
|
||||
'';
|
||||
buildPhase = ''
|
||||
ghc -v ${ghcExeOptions} ./Main.hs -o ./main
|
||||
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
|
||||
mkdir -p $out/src
|
||||
cp ./main $out/bin/elmskell
|
||||
cp ./main.js $out/src/main.js
|
||||
cp ./init.js $out/src/init.js
|
||||
'';
|
||||
|
||||
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"];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue