annotated_annals/flake.nix

42 lines
1.3 KiB
Nix
Raw Normal View History

2022-08-28 12:30:39 -04:00
{
description = "Annotated Annals: A blog";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
2022-08-28 12:30:39 -04:00
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.hermit-zola = { url = "github:IslandUsurper/hermit_zola"; flake = false; };
2022-08-28 12:30:39 -04:00
outputs = { self, nixpkgs, flake-utils, hermit-zola }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
themeName = "hermit_zola";
in
2023-03-27 09:41:04 -04:00
with pkgs;
2022-08-28 12:30:39 -04:00
{
2023-03-27 09:41:04 -04:00
packages.blog = stdenv.mkDerivation rec {
2022-08-28 12:30:39 -04:00
pname = "annotated-annals";
2025-06-25 14:15:27 -04:00
version = "2025-06-25";
2022-08-28 12:30:39 -04:00
src = ./.;
2023-03-27 09:41:04 -04:00
nativeBuildInputs = [ zola ];
2022-08-28 12:30:39 -04:00
configurePhase = ''
2025-06-25 14:28:57 -04:00
if [ -h "themes/${themeName}" ]; then
rm "themes/${themeName}"
fi
mkdir -p "themes/${themeName}"
cp -a ${hermit-zola}/* "themes/${themeName}/"
2022-08-28 12:30:39 -04:00
'';
2025-06-25 14:11:01 -04:00
buildPhase = "${zola}/bin/zola build";
installPhase = "cp -r public $out";
2022-08-28 12:30:39 -04:00
};
defaultPackage = self.packages.${system}.blog;
2023-03-27 09:41:04 -04:00
devShell = mkShell {
2023-06-24 22:21:28 -04:00
packages = [ just zola ];
2022-08-28 12:30:39 -04:00
shellHook = ''
ln -fsn "${hermit-zola}" "themes/${themeName}"
2022-08-28 12:30:39 -04:00
'';
};
});
}