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;
|
2022-01-30 17:06:58 +01:00
|
|
|
homepage = "https://${domain}/";
|
|
|
|
blog = "https://${domain}/blog";
|
|
|
|
habits = "https://${domain}/habits";
|
|
|
|
github = "https://github.com/wpcarro";
|
|
|
|
linkedin = "https://linkedin.com/in/williampatrickcarroll";
|
2021-12-30 20:34:44 +01:00
|
|
|
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;
|
|
|
|
};
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
{
|
2021-12-30 20:34:44 +01:00
|
|
|
inherit domain renderTemplate withBrand;
|
2021-12-27 16:52:53 +01:00
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
root = pkgs.runCommandNoCC "wpcarro.dev" { } ''
|
2021-12-28 01:06:08 +01:00
|
|
|
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
|
|
|
}
|