- Package builds with buildGoModule and CGO_ENABLED=0 - Dev shell provides go_latest, gopls, gotools Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
43 lines
1 KiB
Nix
43 lines
1 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
systems.url = "github:nix-systems/default";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
systems,
|
|
}: let
|
|
eachSystem = f:
|
|
nixpkgs.lib.genAttrs (import systems) (system:
|
|
f (import nixpkgs {inherit system;}));
|
|
in {
|
|
packages = eachSystem (pkgs: rec {
|
|
default = pve-exporter;
|
|
pve-exporter = pkgs.buildGoModule {
|
|
pname = "pve-exporter";
|
|
version = self.shortRev or self.dirtyShortRev or "dev";
|
|
src = ./.;
|
|
vendorHash = "sha256-VC80sdNcahVbxUffNNntlXWOg+ZDalck61d6tL9aWsM=";
|
|
env.CGO_ENABLED = 0;
|
|
ldflags = ["-s" "-w"];
|
|
doCheck = true;
|
|
meta = {
|
|
description = "Prometheus exporter for Proxmox VE";
|
|
mainProgram = "pve-exporter";
|
|
};
|
|
};
|
|
});
|
|
|
|
devShells = eachSystem (pkgs: {
|
|
default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
go_latest
|
|
gopls
|
|
gotools
|
|
];
|
|
};
|
|
});
|
|
};
|
|
}
|