diff --git a/nixos/modules/hardware/video/webcam/facetimehd.nix b/nixos/modules/hardware/video/webcam/facetimehd.nix index 309cedca48ba..2a2fcf3057d4 100644 --- a/nixos/modules/hardware/video/webcam/facetimehd.nix +++ b/nixos/modules/hardware/video/webcam/facetimehd.nix @@ -31,7 +31,7 @@ in # unload module during suspend/hibernate as it crashes the whole system powerManagement.powerDownCommands = '' - ${pkgs.kmod}/bin/rmmod -f facetimehd + ${pkgs.kmod}/bin/lsmod | ${pkgs.gnugrep}/bin/grep -q "^facetimehd" && ${pkgs.kmod}/bin/rmmod -f -v facetimehd ''; # and load it back on resume