9 options.security.auditd.enable = lib.mkEnableOption "the Linux Audit daemon";
11 config = lib.mkIf config.security.auditd.enable {
12 boot.kernelParams = [ "audit=1" ];
14 environment.systemPackages = [ pkgs.audit ];
16 systemd.services.auditd = {
17 description = "Linux Audit daemon";
18 wantedBy = [ "sysinit.target" ];
21 "systemd-tmpfiles-setup.service"
27 conflicts = [ "shutdown.target" ];
30 ConditionVirtualization = "!container";
31 ConditionSecurity = [ "audit" ];
32 DefaultDependencies = false;
35 path = [ pkgs.audit ];
38 ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/log/audit";
39 ExecStart = "${pkgs.audit}/bin/auditd -l -n -s nochange";