I built this on Nix. And it was very easy.
First though, Credit where it’s due, I borrowed from This with some updates.
At the moment, the configuration for this site looks like this:
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
hugo-theme-papermod = runCommand "hugo-theme-papermod"
{
pinned = builtins.fetchTarball {
name = "Hugo-Theme-PaperMod";
url = https://github.com/adityatelange/hugo-PaperMod/archive/3e53621.tar.gz;
sha256 = "00hl085y8bial70jf7xnfg995qs140y96ycgmv8a9r06hsfx1zqf";
};
patches = [ ];
preferLocalBuild = true;
}
''
cp -r $pinned $out
chmod -R u+w $out
for p in $patches; do
echo "Applying patch $p"
patch -d $out -p1 < "$p"
done
'';
in
mkShell {
buildInputs = [
hugo
];
shellHook = ''
mkdir -p themes
ln -snf "${hugo-theme-papermod}" themes/PaperMod
'';
}
Which frankly, is excellent! (Also of note, I’ve set it up so that the text above will always be the current version that’s in use!)
With this, I have in one fell swoop:
- Locked in exactly the version of Hugo in Use
- Locked in exactly the theme version to Use
- And ensured my site should always be able to build!
Hidden Goodies of Note:
There is a Search available, which should just work. Have fun!