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>
This commit is contained in:
2026-02-07 00:55:23 +01:00
parent 86eaeb4b2a
commit 04eba77ac0
4 changed files with 99 additions and 33 deletions

View File

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