watchdog/nix/package.nix
NotAShelf dd18d373de
nix: bump Go vendorHash
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I303383f940002b9bebe24811438c325c6a6a6964
2026-05-26 21:27:18 +03:00

55 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
}: let
versionInfo = lib.importJSON ../version.json;
in
buildGoModule (finalAttrs: {
pname = "watchdog";
version = versionInfo.version;
src = let
fs = lib.fileset;
s = ../.;
in
fs.toSource {
root = s;
fileset = fs.unions [
(s + /cmd)
(s + /internal)
(s + /web)
(s + /go.mod)
(s + /go.sum)
# Checkphase
(s + /test)
(s + /testdata)
(s + /version.json)
];
};
vendorHash = "sha256-778YiWvdfdFtUrEiYLhBONSxjK6caq16LXxQcsHM3Mw=";
ldflags = [
"-s"
"-w"
"-X main.Version=${finalAttrs.version}"
"-X main.Commit=${versionInfo.commit}"
"-X main.BuildDate=${versionInfo.buildDate}"
];
# Copy web assets
postInstall = ''
mkdir -p $out/share/watchdog
cp -r $src/web $out/share/watchdog/
'';
meta = {
description = "Privacy-preserving web analytics with Prometheus-native metrics";
homepage = "https://github.com/notashelf/watchdog";
license = lib.licenses.eupl12;
maintainers = with lib.maintainers; [NotAShelf];
mainProgram = "watchdog";
};
})