Prometheus exporter for NixOS-specific metrics including: - Generation collector: count, current, booted, age, config mismatch - Flake collector: input age, input info, revision behind Includes NixOS module, flake packaging, and documentation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
54 lines
1.4 KiB
Nix
54 lines
1.4 KiB
Nix
{
|
|
description = "Prometheus exporter for NixOS-specific metrics";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
|
};
|
|
|
|
outputs = { self, nixpkgs }:
|
|
let
|
|
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
|
in
|
|
{
|
|
packages = forAllSystems (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
default = pkgs.buildGoModule {
|
|
pname = "nixos-exporter";
|
|
version = "0.1.0";
|
|
src = ./.;
|
|
vendorHash = "sha256-NnvB20rORPS5QF5enbb5KpWaKZ70ybSgfd7wjk21/Cg=";
|
|
|
|
meta = with pkgs.lib; {
|
|
description = "Prometheus exporter for NixOS-specific metrics";
|
|
homepage = "https://git.t-juice.club/torjus/nixos-exporter";
|
|
license = licenses.mit;
|
|
maintainers = [ ];
|
|
platforms = platforms.linux;
|
|
};
|
|
};
|
|
});
|
|
|
|
devShells = forAllSystems (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
go
|
|
gopls
|
|
golangci-lint
|
|
govulncheck
|
|
delve
|
|
];
|
|
};
|
|
});
|
|
|
|
nixosModules.default = import ./module.nix { inherit self; };
|
|
};
|
|
}
|