Merge pull request #156998 from mweinelt/smartctl-exporter-fixups

prometheus.exporters.smartctl: fixes

authored by ajs124 and committed by GitHub 47a2176e 3a4bed48

+13 -2
+13 -2
nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix
··· 25 25 [ "/dev/sda", "/dev/nvme0n1" ]; 26 26 ''; 27 27 description = '' 28 - Paths to disks that will be monitored. 28 + Paths to the disks that will be monitored. Will autodiscover 29 + all disks if none given. 29 30 ''; 30 31 }; 31 32 maxInterval = mkOption { ··· 41 42 serviceOpts = { 42 43 serviceConfig = { 43 44 AmbientCapabilities = [ 45 + "CAP_RAW_SYSIO" 44 46 "CAP_SYS_ADMIN" 45 47 ]; 46 48 CapabilityBoundingSet = [ 49 + "CAP_RAW_SYSIO" 47 50 "CAP_SYS_ADMIN" 48 51 ]; 49 52 DevicePolicy = "closed"; 50 - DeviceAllow = lib.mkForce cfg.devices; 53 + DeviceAllow = lib.mkOverride 100 ( 54 + if cfg.devices != [] then 55 + cfg.devices 56 + else [ 57 + "block-blkext rw" 58 + "block-sd rw" 59 + "char-nvme rw" 60 + ] 61 + ); 51 62 ExecStart = '' 52 63 ${pkgs.prometheus-smartctl-exporter}/bin/smartctl_exporter -config ${configFile} 53 64 '';