Skip to content

Commit

Permalink
make nix-build work
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed May 13, 2021
1 parent 76f06ea commit 7a9357f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
elm-stuff
index.html
result
26 changes: 26 additions & 0 deletions default.nix
@@ -0,0 +1,26 @@
{ sources ? import ./nix/sources.nix { }, nixpkgs ? import sources.nixpkgs { }
}:
let gitignore = nixpkgs.callPackage sources.gitignore { };
in nixpkgs.stdenv.mkDerivation {
name = "bad-datalog";

src = gitignore.gitignoreSource ./.;
buildInputs = [ nixpkgs.elmPackages.elm ];

buildPhase = nixpkgs.elmPackages.fetchElmDeps {
elmPackages = import ./nix/elm-srcs.nix;
elmVersion = "0.19.1";
registryDat = ./nix/registry.dat;
};

# it's a little weird that elm2nix says it's fine to build in the install
# phase, but who am I to judge?
installPhase = ''
mkdir -p $out/share/bad-datalog
(
cd sample-app
elm make src/Main.elm --output $out/share/bad-datalog/index.html
)
'';
}
12 changes: 12 additions & 0 deletions nix/sources.json
@@ -1,4 +1,16 @@
{
"gitignore": {
"branch": "master",
"description": "Nix function for filtering local git sources",
"homepage": "",
"owner": "hercules-ci",
"repo": "gitignore",
"rev": "211907489e9f198594c0eb0ca9256a1949c9d412",
"sha256": "06j7wpvj54khw0z10fjyi31kpafkr6hi1k0di13k1xp8kywvfyx8",
"type": "tarball",
"url": "https://github.com/hercules-ci/gitignore/archive/211907489e9f198594c0eb0ca9256a1949c9d412.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
"branch": "master",
"description": "Easy dependency management for Nix projects",
Expand Down

0 comments on commit 7a9357f

Please sign in to comment.