2021-08-08 13:57:45 +00:00
|
|
|
{pkgs}: rec {
|
2021-07-31 17:35:39 +00:00
|
|
|
|
2021-08-08 13:57:45 +00:00
|
|
|
depInputs = [ pkgs.imagemagick pkgs.exiftool pkgs.bundler pkgs.bundix ];
|
|
|
|
|
|
|
|
depShell = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "mediocre-blog-static-dep-shell";
|
|
|
|
buildInputs = depInputs;
|
|
|
|
};
|
|
|
|
|
|
|
|
jekyllEnv = pkgs.bundlerEnv {
|
|
|
|
name = "jekyllEnv";
|
2021-07-31 17:35:39 +00:00
|
|
|
ruby = pkgs.ruby;
|
|
|
|
gemdir = ./.;
|
|
|
|
};
|
|
|
|
|
2021-08-08 13:57:45 +00:00
|
|
|
build = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "mediocre-blog-static";
|
|
|
|
src = ./src;
|
|
|
|
buildPhase = "${jekyllEnv}/bin/jekyll build";
|
|
|
|
installPhase = "mv _site $out";
|
|
|
|
};
|
|
|
|
|
|
|
|
serve = pkgs.writeScriptBin "static-serve" ''
|
|
|
|
#!/bin/sh
|
|
|
|
exec ${jekyllEnv}/bin/jekyll serve \
|
|
|
|
-s ./src \
|
|
|
|
-d ./_site \
|
|
|
|
-w -I -D \
|
|
|
|
-P 4001
|
|
|
|
'';
|
|
|
|
|
|
|
|
allInputs = depInputs ++ [ jekyllEnv serve ];
|
|
|
|
|
|
|
|
shell = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "mediocre-blog-static-shell";
|
|
|
|
buildInputs = allInputs;
|
|
|
|
};
|
|
|
|
}
|