audit module: only enable service if kernel has audit (#19569)

authored by

Alexander Ried and committed by
Franz Pletz
d91365d7 267c7a29

+5 -1
+5 -1
nixos/modules/security/audit.nix
··· 104 104 description = "Kernel Auditing"; 105 105 wantedBy = [ "basic.target" ]; 106 106 107 - unitConfig.ConditionVirtualization = "!container"; 107 + unitConfig = { 108 + ConditionVirtualization = "!container"; 109 + ConditionSecurity = [ "audit" ]; 110 + }; 111 + 108 112 109 113 path = [ pkgs.audit ]; 110 114