From cff89b6864874634a27bf0f2bc107dcb11ce5799 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 31 Jul 2022 16:40:33 +0200 Subject: [PATCH] packages/landing: base configuration --- packages/websites/landing/.envrc | 1 + packages/websites/landing/.gitignore | 12 +++++++++ .../websites/landing/archetypes/default.md | 6 +++++ packages/websites/landing/project.nix | 25 ++++++++++++++++--- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 packages/websites/landing/.gitignore create mode 100644 packages/websites/landing/archetypes/default.md diff --git a/packages/websites/landing/.envrc b/packages/websites/landing/.envrc index dbcfe1b..5d84e98 100644 --- a/packages/websites/landing/.envrc +++ b/packages/websites/landing/.envrc @@ -1 +1,2 @@ source ../../build-support/activate-shell +nix_direnv_watch_file project.nix diff --git a/packages/websites/landing/.gitignore b/packages/websites/landing/.gitignore new file mode 100644 index 0000000..9d67c17 --- /dev/null +++ b/packages/websites/landing/.gitignore @@ -0,0 +1,12 @@ +# hugo generated files +public/ +resources/_gen/ +assets/jsconfig.json +.hugo_build.lock +hugo_stats.json + +# nix config only +/config.toml +/config.yaml +/config.yml +/config.json diff --git a/packages/websites/landing/archetypes/default.md b/packages/websites/landing/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/packages/websites/landing/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/packages/websites/landing/project.nix b/packages/websites/landing/project.nix index 8fad7bf..a706c93 100644 --- a/packages/websites/landing/project.nix +++ b/packages/websites/landing/project.nix @@ -1,9 +1,26 @@ -{ pkgs, ... }: +{ lib, pkgs, self', ... }: +let + theme = self'.packages.gohugo-theme-ananke; + themeName = "ananke"; + themesDir = "${theme}/share/hugo/themes"; + + configFile = pkgs.writeText "hugo-config.json" (builtins.toJSON { + title = "Private Void | Zero-maintenance perfection"; + baseURL = "https://www.privatevoid.net/"; + languageCode = "en-us"; + theme = themeName; + inherit themesDir; + }); + hugoArgs = [ + "--config" configFile + ]; +in { projectShells.landing = { - tools = with pkgs; [ - hugo - ]; + commands.hugo = { + help = pkgs.hugo.meta.description; + command = "exec ${pkgs.hugo}/bin/hugo ${lib.concatStringsSep " " hugoArgs} \"$@\""; + }; }; }