mediocre-blog/default.nix

40 lines
1.1 KiB
Nix
Raw Normal View History

2021-01-22 00:22:53 +00:00
{
pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/cd63096d6d887d689543a0b97743d28995bc9bc3.tar.gz") {},
system ? builtins.currentSystem,
}:
let
jekyll_env = pkgs.bundlerEnv {
name = "jekyll_env";
ruby = pkgs.ruby;
gemdir = ./.;
};
2021-02-26 20:56:52 +00:00
shell_inputs = [ jekyll_env pkgs.imagemagick pkgs.exiftool ];
2021-01-22 00:22:53 +00:00
in
{
build = derivation {
inherit jekyll_env system;
2021-02-26 20:56:52 +00:00
2021-01-22 00:22:53 +00:00
name = "mediocre-blog";
builder = "${pkgs.bash}/bin/bash";
args = [ ./build.sh ];
src = ./src;
stdenv = pkgs.stdenv;
};
serve = pkgs.stdenv.mkDerivation {
2021-02-26 20:56:52 +00:00
name = "mediocre-blog-shell-serve";
buildInputs = shell_inputs;
2021-01-22 00:22:53 +00:00
shellHook = ''
exec ${jekyll_env}/bin/jekyll serve -s ./src -d ./_site -w -I -D -H 0.0.0.0
'';
};
2021-02-26 20:56:52 +00:00
shell = pkgs.stdenv.mkDerivation {
name = "mediocre-blog-shell";
buildInputs = shell_inputs;
};
2021-01-22 00:22:53 +00:00
}