dracol.ing

a work in progress

New Toys

I decided today to update my website, boy oh boy that was a saga.

First I had to remember where I kept these files, then remember how to compile and upload the site. There was some brief detours with troubleshooting (tip: hugo won’t compile pages in the future by default, check your date when posting).

I decided that since I’m playing with NixOS for my coding environments now anyway, it was time to move everything over there and maybe do it more correctly.

Now I have the site set up in a custom direnv environment with a flake that makes sure I have both hugo and the sr.hut tool installed:

.envrc:

use flake .

flake.nix:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, utils }:
    utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { inherit system; };
      in
      {
        devShell = with pkgs; mkShell {
          buildInputs = [
            hut
            hugo
          ];
        };
      }
    );
}

With a quick direnv allow and some git management (to make the flake happy), now when I cd into the web dir I get the tools I need automatically installed (even if they aren’t already).

My existing build.sh file works to build and post the site, so nothing had to change there.

build.sh:

rm site.tar.gz
hugo 
tar -C public -cvz . > site.tar.gz
hut pages publish -d home.dracol.ing site.tar.gz

I still need to change the default templates and maybe make the archtypes better for post creation, but for now we’re up and running.

Tags:

Friends and Favorites:

Add me: