nix: initial nixos module; complete packaging

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I59ec5a4f67ddae2139e72ef4c0c113366a6a6964
This commit is contained in:
raf 2026-03-01 14:17:10 +03:00
commit 75018f69df
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 223 additions and 10 deletions

View file

@ -1,11 +1,40 @@
{buildGoModule}:
buildGoModule {
pname = "sample-go";
version = "0.0.1";
{
lib,
buildGoModule,
}:
buildGoModule (finalAttrs: {
pname = "watchdog";
version = "0.1.0";
src = ../.;
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 = "";
vendorHash = "sha256-jMqPVvMZDm406Gi2g4zNSRJMySLAN7/CR/2NgF+gqtA=";
ldflags = ["-s" "-w"];
}
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";
};
})