diff options
author | ajs124 <ajs124@users.noreply.github.com> | 2022-01-27 18:49:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 18:49:49 +0100 |
commit | 47a2176ec80b7d74401df84e4c49b86f5b9c30f9 (patch) | |
tree | 0c2e3cbc7116bddf1be25d847100d6224d6577ab | |
parent | 3a4bed480a4c07385927ab2580ff1c866a1ee8c6 (diff) | |
parent | 12c26aca1fd55ab99f831bedc865a626eee39f80 (diff) | |
download | nixpkgs-47a2176ec80b7d74401df84e4c49b86f5b9c30f9.tar nixpkgs-47a2176ec80b7d74401df84e4c49b86f5b9c30f9.tar.gz nixpkgs-47a2176ec80b7d74401df84e4c49b86f5b9c30f9.tar.bz2 nixpkgs-47a2176ec80b7d74401df84e4c49b86f5b9c30f9.tar.lz nixpkgs-47a2176ec80b7d74401df84e4c49b86f5b9c30f9.tar.xz nixpkgs-47a2176ec80b7d74401df84e4c49b86f5b9c30f9.tar.zst nixpkgs-47a2176ec80b7d74401df84e4c49b86f5b9c30f9.zip |
Merge pull request #156998 from mweinelt/smartctl-exporter-fixups
prometheus.exporters.smartctl: fixes
-rw-r--r-- | nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix b/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix index b6416b93e69..9e49601ce1a 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/smartctl.nix @@ -25,7 +25,8 @@ in { [ "/dev/sda", "/dev/nvme0n1" ]; ''; description = '' - Paths to disks that will be monitored. + Paths to the disks that will be monitored. Will autodiscover + all disks if none given. ''; }; maxInterval = mkOption { @@ -41,13 +42,23 @@ in { serviceOpts = { serviceConfig = { AmbientCapabilities = [ + "CAP_RAW_SYSIO" "CAP_SYS_ADMIN" ]; CapabilityBoundingSet = [ + "CAP_RAW_SYSIO" "CAP_SYS_ADMIN" ]; DevicePolicy = "closed"; - DeviceAllow = lib.mkForce cfg.devices; + DeviceAllow = lib.mkOverride 100 ( + if cfg.devices != [] then + cfg.devices + else [ + "block-blkext rw" + "block-sd rw" + "char-nvme rw" + ] + ); ExecStart = '' ${pkgs.prometheus-smartctl-exporter}/bin/smartctl_exporter -config ${configFile} ''; |