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>
This commit is contained in:
2026-02-07 00:27:38 +01:00
parent 9c29505814
commit 86eaeb4b2a
3 changed files with 11 additions and 89 deletions

View File

@@ -15,7 +15,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
)
const version = "0.2.0"
const version = "0.2.1"
func main() {
cfg, err := config.Parse()