diff options
Diffstat (limited to 'users/wpcarro/website/default.nix')
-rw-r--r-- | users/wpcarro/website/default.nix | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/users/wpcarro/website/default.nix b/users/wpcarro/website/default.nix index b20de562ab6f..9694aad17d60 100644 --- a/users/wpcarro/website/default.nix +++ b/users/wpcarro/website/default.nix @@ -4,18 +4,33 @@ let inherit (builtins) readFile; inherit (depot.users) wpcarro; - render = contentHtml: pkgs.substituteAll { + 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 { inherit contentHtml; - src = ./fragments/template.html; }; in { - inherit render; + inherit domain renderTemplate withBrand; root = pkgs.runCommandNoCC "wpcarro.dev" {} '' mkdir -p $out # / - cp ${render (readFile ./fragments/homepage.html)} $out/index.html + cp ${withBrand (readFile (renderTemplate ./fragments/homepage.html {}))} $out/index.html # /habits mkdir -p $out/habits |