-
Notifications
You must be signed in to change notification settings - Fork 3
/
jekyll.nix
45 lines (37 loc) · 1.05 KB
/
jekyll.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
nixpkgs ? import (builtins.fetchGit {
url = "https://[email protected]/siriobalmelli-foss/nixpkgs.git";
ref = "refs/tags/sirio-2022-08-24";
}) { },
}:
with nixpkgs;
let
rubyEnv = ruby.withPackages (p: with p; [
github-pages
jekyll
jekyll-theme-minimal
]);
in
stdenv.mkDerivation rec {
name = "nonlibcDocumentation";
buildInputs = [
rubyEnv
];
# work with the current directory. ignore all files not in version control
src = if lib.inNixShell then null else nix-gitignore.gitignoreSource [] ./.;
buildPhase = ''
bundle exec jekyll build -d "$out"
'';
dontInstall = true;
# scripts and executables served by Jekyll must run on systems that download them
# which would be broken if their #! were patched to /nix/store/[derivation]
dontStrip = true;
dontMoveSbin = true;
dontPatchELF = true;
dontPatchShebangs = true;
shellHook = ''
rm -rf .bundle
echo "# to build and serve locally, run:"
echo "jekyll serve --watch"
'';
}