nixos/prometheus.exporters.smartctl: Simplify DeviceAllow logic
Setting up the DeviceAllow list with explicitly configured devices was a nice idea, but sometimes a configured device (`/dev/nvme0n1` an NVMe namespace) has a parent device (`/dev/nvme0`) that smartctl needs to access to query metrics. Falling back to the block and character definitions is probably a valid fallback.
This commit is contained in:
parent
a49feed255
commit
fdcc9e8202
@ -46,15 +46,11 @@ in {
|
||||
"CAP_SYS_ADMIN"
|
||||
];
|
||||
DevicePolicy = "closed";
|
||||
DeviceAllow = lib.mkOverride 50 (
|
||||
if cfg.devices != [] then
|
||||
cfg.devices
|
||||
else [
|
||||
"block-blkext rw"
|
||||
"block-sd rw"
|
||||
"char-nvme rw"
|
||||
]
|
||||
);
|
||||
DeviceAllow = lib.mkOverride 50 [
|
||||
"block-blkext rw"
|
||||
"block-sd rw"
|
||||
"char-nvme rw"
|
||||
];
|
||||
ExecStart = ''
|
||||
${pkgs.prometheus-smartctl-exporter}/bin/smartctl_exporter ${args}
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user