with (import <nixpkgs> {});
let
  hugo-theme-mainroad = pkgs.stdenvNoCC.mkDerivation {
    name = "hugo-theme-mainroad";
    src = pkgs.fetchFromGitHub {
      owner = "vimux";
      repo = "mainroad";
      rev = "af0dc2e1207f7676bc2abf878f3671ff32b02c32";
      sha256 = "172lvvh2xiam5m58criywwaq15db84zi3g5f325v5aywm8607b8v";
    };
    installPhase = ''
      cp -r $src $out
    '';
    preferLocalBuild = true;
  };
in
mkShell {
  buildInputs = [
    hugo
  ];

  shellHook = ''
    mkdir -p themes
    ln -snf "${hugo-theme-mainroad}/" "themes/mainroad"
  '';
}
