nix: add build support for zola-based about pages

This commit is contained in:
Vincent Breitmoser
2025-09-28 20:17:04 +02:00
parent 418c686398
commit f272c7147e
4 changed files with 38 additions and 1 deletions

26
aboutPages/default.nix Normal file
View File

@@ -0,0 +1,26 @@
{ lib, stdenvNoCC, zola, commitShaShort ? "" }:
stdenvNoCC.mkDerivation rec {
pname = "hagridAboutPages";
version = "2.1.0";
src = ./.;
nativeBuildInputs = [
zola
];
buildPhase = ''
zola build --output-dir $out/about
'';
COMMIT_SHA_SHORT = commitShaShort;
meta = with lib; {
description = "A verifying keyserver (about pages)";
homepage = "https://gitlab.com/keys.openpgp.org/hagrid";
license = with licenses; [ gpl3 ];
maintainers = with maintainers; [ valodim ];
platforms = platforms.all;
};
}

View File

@@ -4,7 +4,12 @@ rustPlatform.buildRustPackage rec {
pname = "hagrid";
version = "2.1.0";
src = ./.;
# src = ./.;
# avoid rebuilds when only about pages change
src = builtins.filterSource
(path: type: !(type == "directory" && baseNameOf path == "aboutPages"))
./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {

View File

@@ -13,10 +13,13 @@
packages.wkdDomainChecker = pkgs.callPackage ./wkd-domain-checker/. { };
packages.default = packages.hagrid;
packages.hagridAboutPages = pkgs.callPackage ./aboutPages { };
}) // {
overlays.hagrid = (final: prev: {
hagrid = self.packages."${final.system}".hagrid;
hagridctl = self.packages."${final.system}".hagridctl;
hagridAboutPages = self.packages."${final.system}".hagridAboutPages;
});
overlays.wkdDomainChecker = (final: prev: { wkdDomainChecker = self.packages."${final.system}".wkdDomainChecker; });

View File

@@ -25,6 +25,9 @@ pkgs.mkShell {
gettext
transifex-client
# static site generator used for /about pages
zola
];
# Set Environment Variables