git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #82817 from pacien/smartd-fix-hostname-notifications

smartmontools: fix missing hostname in notifications

commitf8e6745ad30fa35a2d95096fd955ef73fcd40594 authorSilvan Mosberger <contact@infinisil.com> dateSat 22 Aug 2020, 16:09 (6 years ago) parent34e4b4fea37c9c
2 files changed+6−5
nixos/modules/services/monitoring/smartd.nix+1−5 pkgs/tools/system/smartmontools/default.nix+5
nixos/modules/services/monitoring/smartd.nix+1−5
@@ -20,7 +20,7 @@ let
2020 ${pkgs.coreutils}/bin/cat << EOF
2121 From: smartd on ${host} <${nm.sender}>
2222 To: undisclosed-recipients:;
23− Subject: SMART error on $SMARTD_DEVICESTRING: $SMARTD_FAILTYPE
23+ Subject: $SMARTD_SUBJECT
2424
2525 $SMARTD_FULLMESSAGE
2626 EOF
@@ -239,11 +239,7 @@ in
239239
240240 systemd.services.smartd = {
241241 description = "S.M.A.R.T. Daemon";
242−
243242 wantedBy = [ "multi-user.target" ];
244−
245− path = [ pkgs.nettools ]; # for hostname and dnsdomanname calls in smartd
246−
247243 serviceConfig.ExecStart = "${pkgs.smartmontools}/sbin/smartd ${lib.concatStringsSep " " cfg.extraOptions} --no-fork --configfile=${smartdConf}";
248244 };
249245
pkgs/tools/system/smartmontools/default.nix+5
@@ -1,4 +1,5 @@
11{ stdenv, fetchurl, autoreconfHook
2+, mailutils, inetutils
23, IOKit ? null , ApplicationServices ? null }:
34
45let
@@ -24,6 +25,10 @@ in stdenv.mkDerivation rec {
2425 patches = [ ./smartmontools.patch ];
2526 postPatch = "cp -v ${driverdb} drivedb.h";
2627
28+ configureFlags = [
29+ "--with-scriptpath=${stdenv.lib.makeBinPath [ mailutils inetutils ]}"
30+ ];
31+
2732 nativeBuildInputs = [ autoreconfHook ];
2833 buildInputs = [] ++ stdenv.lib.optionals stdenv.isDarwin [IOKit ApplicationServices];
2934 enableParallelBuilding = true;