brian
/
bad-datalog
Archived
1
0
Fork 0

build playground with nix

fresh-start
Brian Hicks 2020-10-11 23:28:27 -05:00
parent 137dcc44f6
commit d2c55dcf0f
7 changed files with 102 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/result
elm-stuff
index.html

6
Makefile Normal file
View File

@ -0,0 +1,6 @@
nix/elm-srcs.nix: playground/elm.json
cd playground && elm2nix convert > ../$@
nix/registry.dat: playground/elm.json
cd playground && elm2nix snapshot
mv playground/registry.dat $@

29
default.nix Normal file
View File

@ -0,0 +1,29 @@
{ ... }:
let
sources = import ./nix/sources.nix;
nixpkgs = import sources.nixpkgs { };
gitignore = import sources.gitignore { };
in with nixpkgs;
stdenv.mkDerivation {
name = "datalog";
src = gitignore.gitignoreSource ./.;
buildInputs = [ elmPackages.elm elmPackages.elm-test ];
buildPhase = pkgs.elmPackages.fetchElmDeps {
elmPackages = import ./nix/elm-srcs.nix;
elmVersion = "0.19.1";
registryDat = ./nix/registry.dat;
};
doCheck = true;
checkPhase = ''
env ELM_HOME=.elm elm-test
'';
installPhase = ''
mkdir -p $out/share/datalog
cd playground
elm make --optimize --output $out/share/datalog/index.html src/Main.elm
'';
}

52
nix/elm-srcs.nix Normal file
View File

@ -0,0 +1,52 @@
{
"elm/html" = {
sha256 = "1n3gpzmpqqdsldys4ipgyl1zacn0kbpc3g4v3hdpiyfjlgh8bf3k";
version = "1.0.0";
};
"elm/parser" = {
sha256 = "0a3cxrvbm7mwg9ykynhp7vjid58zsw03r63qxipxp3z09qks7512";
version = "1.1.0";
};
"elm/browser" = {
sha256 = "0nagb9ajacxbbg985r4k9h0jadqpp0gp84nm94kcgbr5sf8i9x13";
version = "1.0.2";
};
"rtfeldman/elm-css" = {
sha256 = "0nxiyxyw3kw55whkpwhrcgc0dr6a8zlm2nqvsaqdw6mzkykg0ba6";
version = "16.1.0";
};
"elm/core" = {
sha256 = "19w0iisdd66ywjayyga4kv2p1v9rxzqjaxhckp8ni6n8i0fb2dvf";
version = "1.0.5";
};
"elm/json" = {
sha256 = "0kjwrz195z84kwywaxhhlnpl3p251qlbm5iz6byd6jky2crmyqyh";
version = "1.1.3";
};
"rtfeldman/elm-hex" = {
sha256 = "1y0aa16asvwdqmgbskh5iba6psp43lkcjjw9mgzj3gsrg33lp00d";
version = "1.0.0";
};
"elm/url" = {
sha256 = "0av8x5syid40sgpl5vd7pry2rq0q4pga28b4yykn9gd9v12rs3l4";
version = "1.0.0";
};
"elm/time" = {
sha256 = "0vch7i86vn0x8b850w1p69vplll1bnbkp8s383z7pinyg94cm2z1";
version = "1.0.0";
};
"elm/virtual-dom" = {
sha256 = "0q1v5gi4g336bzz1lgwpn5b1639lrn63d8y6k6pimcyismp2i1yg";
version = "1.0.2";
};
}

BIN
nix/registry.dat Normal file

Binary file not shown.

View File

@ -1,4 +1,16 @@
{
"gitignore": {
"branch": "master",
"description": "Nix function for filtering local git sources",
"homepage": "",
"owner": "hercules-ci",
"repo": "gitignore",
"rev": "c4662e662462e7bf3c2a968483478a665d00e717",
"sha256": "1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx",
"type": "tarball",
"url": "https://github.com/hercules-ci/gitignore/archive/c4662e662462e7bf3c2a968483478a665d00e717.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
"branch": "master",
"description": "Easy dependency management for Nix projects",

View File

@ -11,10 +11,12 @@ stdenv.mkDerivation {
buildInputs = [
niv.niv
git
gnumake
# elm
elmPackages.elm
elmPackages.elm-format
elmPackages.elm-test
elm2nix
];
}