2021-12-14 04:51:48 +01:00
|
|
|
{ pkgs, depot, ... }:
|
2020-03-20 01:22:13 +01:00
|
|
|
|
2021-12-28 01:06:08 +01:00
|
|
|
let
|
|
|
|
inherit (builtins) readFile;
|
2021-12-27 16:52:53 +01:00
|
|
|
inherit (depot.users) wpcarro;
|
|
|
|
|
2021-12-30 20:34:44 +01:00
|
|
|
domain = "billandhiscomputer.com";
|
|
|
|
|
|
|
|
globalVars = {
|
|
|
|
inherit domain;
|
|
|
|
homepage = "https://${domain}/";
|
|
|
|
blog = "https://${domain}/blog";
|
|
|
|
habits = "https://${domain}/habits";
|
|
|
|
github = "https://github.com/wpcarro";
|
|
|
|
linkedin = "https://linkedin.com/in/williampatrickcarroll";
|
|
|
|
depotWork = "https://cs.tvl.fyi/depot/-/blob/users/wpcarro";
|
|
|
|
};
|
|
|
|
|
|
|
|
renderTemplate = src: vars: pkgs.substituteAll (globalVars // vars // {
|
|
|
|
inherit src;
|
|
|
|
});
|
|
|
|
|
|
|
|
withBrand = contentHtml: renderTemplate ./fragments/template.html {
|
2021-12-28 01:06:08 +01:00
|
|
|
inherit contentHtml;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2021-12-30 20:34:44 +01:00
|
|
|
inherit domain renderTemplate withBrand;
|
2021-12-27 16:52:53 +01:00
|
|
|
|
2021-12-28 01:06:08 +01:00
|
|
|
root = pkgs.runCommandNoCC "wpcarro.dev" { } ''
|
|
|
|
mkdir -p $out
|
2021-12-27 16:52:53 +01:00
|
|
|
|
2021-12-28 01:06:08 +01:00
|
|
|
# /
|
2021-12-30 20:34:44 +01:00
|
|
|
cp ${withBrand (readFile (renderTemplate ./fragments/homepage.html {}))} $out/index.html
|
2021-12-27 16:52:53 +01:00
|
|
|
|
2021-12-28 01:06:08 +01:00
|
|
|
# /habits
|
|
|
|
mkdir -p $out/habits
|
|
|
|
cp -r ${wpcarro.website.habit-screens} $out/habits/index.html
|
2021-12-27 16:52:53 +01:00
|
|
|
|
2021-12-28 01:06:08 +01:00
|
|
|
# /blog
|
2021-12-28 01:17:20 +01:00
|
|
|
cp -r ${wpcarro.website.blog} $out/blog
|
2021-12-28 01:06:08 +01:00
|
|
|
'';
|
2020-03-20 01:22:13 +01:00
|
|
|
}
|