From dd465b6ac6727d0099a4bc7a509c5f4a212ef68f Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Mon, 11 Apr 2022 19:24:34 -0400 Subject: [PATCH] Cleanup hugo module --- README.org | 10 ++++++---- modules/hugo.nix | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.org b/README.org index 230a6c0..56f7a78 100644 --- a/README.org +++ b/README.org @@ -680,21 +680,23 @@ Apply some configuration to the default settings: ./modules/hugo.nix #+END_SRC -[[https://gohugo.io][Hugo]] is one of the most popular open-source static site generators. +[[https://gohugo.io][Hugo]] is one of the most popular open-source static site generators. I use it to build https://chrishayward.xyz which is included in a later section of this configuration. This module adds a custom package to push the site to the server. #+BEGIN_SRC nix :noweb yes :tangle modules/hugo.nix # <> { config, pkgs, ... }: let - myUpdateSite = pkgs.writeShellScriptBin "update-site" '' - rsync -aP /etc/dotfiles/docs/public/ ubuntu@chrishayward.xyz:/var/www/chrishayward + mySiteDir = "/etc/dotfiles/docs/public/"; + mySiteTgt = "unbuntu@chrishayward.xyz:/var/www/wedding"; + mySiteUpdate = pkgs.writeShellScriptBin "my-site-update" '' + ${pkgs.rsync}/bin/rsync -aP ${mySiteDir} ${mySiteTgt} ''; in { environment.systemPackages = [ pkgs.hugo - myUpdateSite + mySiteUpdate ]; } #+END_SRC diff --git a/modules/hugo.nix b/modules/hugo.nix index 30e3ee9..2b143cc 100644 --- a/modules/hugo.nix +++ b/modules/hugo.nix @@ -2,13 +2,15 @@ { config, pkgs, ... }: let - myUpdateSite = pkgs.writeShellScriptBin "update-site" '' - rsync -aP /etc/dotfiles/docs/public/ ubuntu@chrishayward.xyz:/var/www/chrishayward + mySiteDir = "/etc/dotfiles/docs/public/"; + mySiteTgt = "unbuntu@chrishayward.xyz:/var/www/wedding"; + mySiteUpdate = pkgs.writeShellScriptBin "my-site-update" '' + ${pkgs.rsync}/bin/rsync -aP ${mySiteDir} ${mySiteTgt} ''; in { environment.systemPackages = [ pkgs.hugo - myUpdateSite + mySiteUpdate ]; }