4 Commits

Author SHA1 Message Date
cf0ce85899 fix: use absolute path for nixos-version executable
Use /run/current-system/sw/bin/nixos-version instead of relying on
PATH, since the systemd service may not have the system binaries in
its PATH.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 01:02:02 +01:00
04eba77ac0 fix: use nixos-version --json for configuration revision
- Use `nixos-version --json` command instead of reading files directly
- Add nixpkgs_rev and nixos_version labels to nixos_flake_info metric
- Show "unknown" for current_rev when system.configurationRevision not set
- Document configurationRevision setup in README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 00:55:23 +01:00
86eaeb4b2a fix: use configuration-revision for current_rev in flake info metric
The nixos_flake_info metric's current_rev label was incorrectly showing
the nixpkgs input revision (from /run/current-system/nixos-version)
instead of the flake's own revision.

Now reads from /run/current-system/configuration-revision which contains
the flake's self.rev when system.configurationRevision is set in the
NixOS configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 00:27:38 +01:00
f637da487c feat: implement nixos-exporter
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>
2026-02-06 22:52:28 +01:00