dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
site/git/assets.nix (829B)
1{
2 lib,
3 pkgs,
4 gitSite ? null,
5}: let
6 mainSite = (fromTOML (builtins.readFile ../zola.toml)).base_url;
7in
8 pkgs.stdenvNoCC.mkDerivation {
9 pname = "gitsite-assets";
10 version = "1";
11 src = ../.;
12 nativeBuildInputs = [
13 pkgs.zola
14 (pkgs.python3.withPackages (ps: [ps.lxml]))
15 ];
16 buildPhase = ''
17 runHook preBuild
18 cat > content/git-shell.md <<'EOF'
19 +++
20 template = "git-shell.html"
21 in_search_index = false
22 +++
23 EOF
24 ${lib.optionalString (gitSite != null) ''
25 substituteInPlace zola.toml --replace-fail 'https://git.maydayv7.dev' ${lib.escapeShellArg gitSite}
26 ''}
27 zola build
28 runHook postBuild
29 '';
30 installPhase = ''
31 python3 git/assemble.py export public "$out" --base-url ${lib.escapeShellArg mainSite}
32 '';
33 }