tvl-depot/users/wpcarro/website/default.nix
William Carroll e107311cb8 refactor(wpcarro/website): Prefer substituteAll
`substituteAll` supports templating with @variables@, which I think really
cleans things up.

Change-Id: Icfad15ac9e174495ba02260d817f7330f1616c6f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4722
Reviewed-by: wpcarro <wpcarro@gmail.com>
Autosubmit: wpcarro <wpcarro@gmail.com>
Tested-by: BuildkiteCI
2021-12-28 00:09:36 +00:00

27 lines
550 B
Nix

{ pkgs, depot, ... }:
let
inherit (builtins) readFile;
inherit (depot.users) wpcarro;
render = contentHtml: pkgs.substituteAll {
inherit contentHtml;
src = ./fragments/template.html;
};
in {
inherit render;
root = pkgs.runCommandNoCC "wpcarro.dev" {} ''
mkdir -p $out
# /
cp ${render (readFile ./fragments/homepage.html)} $out/index.html
# /habits
mkdir -p $out/habits
cp -r ${wpcarro.website.habit-screens} $out/habits/index.html
# /blog
cp -r ${wpcarro.website.blog.root} $out/blog
'';
}