watchdog/nix/package.nix
NotAShelf 75018f69df
nix: initial nixos module; complete packaging
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I59ec5a4f67ddae2139e72ef4c0c113366a6a6964
2026-03-02 22:38:08 +03:00

40 lines
857 B
Nix

{
lib,
buildGoModule,
}:
buildGoModule (finalAttrs: {
pname = "watchdog";
version = "0.1.0";
src = let
fs = lib.fileset;
s = ../.;
in
fs.toSource {
root = s;
fileset = fs.unions [
(s + /cmd)
(s + /internal)
(s + /go.mod)
(s + /go.sum)
];
};
vendorHash = "sha256-jMqPVvMZDm406Gi2g4zNSRJMySLAN7/CR/2NgF+gqtA=";
ldflags = ["-s" "-w" "-X main.version=${finalAttrs.version}"];
# 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.gpl3Only;
maintainers = with lib.maintainers; [NotAShelf];
mainProgram = "watchdog";
};
})