From 414c61841fc5e5eec1bd3fed75494ed3d52a87a2 Mon Sep 17 00:00:00 2001 From: Tobias Pflug Date: Wed, 1 Nov 2017 12:06:58 +0100 Subject: [PATCH] nix: make the project buildable Previously default.nix could only be used for nix-shell invocation. Now the deriation can also be built using `nix-build`. The build calls ./test.sh during the checkPhase. --- default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/default.nix b/default.nix index 30b869b6..85e33554 100644 --- a/default.nix +++ b/default.nix @@ -9,9 +9,24 @@ let jekyll_env = bundlerEnv rec { }; in stdenv.mkDerivation rec { + src = lib.cleanSource ./.; name = "jekyll_env"; + buildInputs = [ jekyll_env ]; + doCheck = true; + + checkPhase = '' + ./test.sh + ''; + + buildPhase = "true"; + + installPhase = '' + mkdir $out + jekyll build --destination $out + ''; + shellHook = '' jekyll serve --watch '';