nix: initial nixos module; complete packaging
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I59ec5a4f67ddae2139e72ef4c0c113366a6a6964
This commit is contained in:
parent
da1fab4257
commit
75018f69df
3 changed files with 223 additions and 10 deletions
|
|
@ -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";
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue