From df1a8ca844eba042cb624630e890fa1a8a4c766b Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Tue, 26 Nov 2024 23:28:05 +0000 Subject: [PATCH] modules/vmCommon: configure smartd to ignore QEMU devices --- nix/nixos-modules/vmCommon.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nix/nixos-modules/vmCommon.nix b/nix/nixos-modules/vmCommon.nix index def7f5d..ace614c 100644 --- a/nix/nixos-modules/vmCommon.nix +++ b/nix/nixos-modules/vmCommon.nix @@ -8,6 +8,8 @@ }: let cfg = config.x-banananetwork.vmCommon; + inherit (builtins) genList; + inherit (lib.trivial) flip; in { @@ -162,6 +164,14 @@ in openFirewall = true; }; + smartd = { + # ignore QEMU drives + devices = flip genList 9 (n: { + device = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi${toString n}"; + options = "-d ignore"; + }); + }; + }; system.autoUpgrade = {