prometheus-libvirt-exporter: refactor (#478425)

This commit is contained in:
Doron Behar
2026-04-05 13:29:14 +00:00
committed by GitHub
3 changed files with 7 additions and 4 deletions
@@ -10,11 +10,9 @@
let
inherit (lib)
concatStrings
foldl
foldl'
genAttrs
literalExpression
maintainers
mapAttrs
mapAttrsToList
mkDefault
@@ -22,9 +20,7 @@ let
mkIf
mkMerge
mkOption
optional
types
mkOptionDefault
flip
attrNames
xor
@@ -328,6 +324,7 @@ let
description = "Prometheus ${name} exporter service user";
isSystemUser = true;
inherit (conf) group;
extraGroups = mkIf (name == "libvirt") [ "libvirtd" ];
}
);
users.groups = mkMerge [
@@ -24,6 +24,11 @@ in
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
--libvirt.uri ${cfg.libvirtUri} ${lib.concatStringsSep " " cfg.extraFlags}
'';
RestrictAddressFamilies = [
"AF_UNIX"
"AF_INET"
"AF_INET6"
];
};
};
}
@@ -30,5 +30,6 @@ buildGoModule (finalAttrs: {
homepage = "https://github.com/Tinkoff/libvirt-exporter";
license = lib.licenses.asl20;
maintainers = [ ];
mainProgram = "libvirt-exporter";
};
})