44 fetchFromGitHub ,
55 autoreconfHook ,
66 bash ,
7+ bashNonInteractive ,
78 buildPackages ,
89 linuxHeaders ,
910 python3 ,
1011 swig ,
1112 pkgsCross ,
1213 libcap_ng ,
14+ installShellFiles ,
1315
1416 # Enabling python support while cross compiling would be possible, but the
1517 # configure script tries executing python to gather info instead of relying on
2123} :
2224stdenv . mkDerivation ( finalAttrs : {
2325 pname = "audit" ;
24- version = "4.1.0 " ;
26+ version = "4.1.1-unstable-2025-08-01 " ;
2527
2628 src = fetchFromGitHub {
2729 owner = "linux-audit" ;
2830 repo = "audit-userspace" ;
29- tag = "v ${ finalAttrs . version } " ;
30- hash = "sha256-MWlHaGue7Ca8ks34KNg74n4Rfj8ivqAhLOJHeyE2Q04 =" ;
31+ rev = "bee5984843d0b38992a369825a87a65fb54b18fc" ; # musl fixes, --disable-legacy-actions and --runstatedir support
32+ hash = "sha256-l3JHWEHz2xGrYxEvfCUD29W8xm5llUnXwX5hLymRG74 =" ;
3133 } ;
3234
33- patches = [
34- # https://github.com/linux-audit/audit-userspace/pull/476
35- ./musl.patch
36- ] ;
37-
3835 postPatch = ''
3936 substituteInPlace bindings/swig/src/auditswig.i \
4037 --replace-fail "/usr/include/linux/audit.h" \
@@ -61,6 +58,7 @@ stdenv.mkDerivation (finalAttrs: {
6158
6259 nativeBuildInputs = [
6360 autoreconfHook
61+ installShellFiles
6462 ]
6563 ++ lib . optionals enablePython [
6664 python3
@@ -76,14 +74,34 @@ stdenv.mkDerivation (finalAttrs: {
7674 # z/OS plugin is not useful on Linux, and pulls in an extra openldap
7775 # dependency otherwise
7876 "--disable-zos-remote"
77+ # remove legacy start/stop scripts to remove a bash dependency in $lib
78+ # People interested in logging auditd interactions (e.g. for compliance) can start/stop audit using `auditctl --signal`
79+ # See also https://github.com/linux-audit/audit-userspace?tab=readme-ov-file#starting-and-stopping-the-daemon
80+ "--disable-legacy-actions"
7981 "--with-arm"
8082 "--with-aarch64"
83+ "--with-io_uring"
84+ # allows putting audit files in /run/audit, which removes the requirement
85+ # to wait for tmpfiles to set up the /var/run -> /run symlink
86+ "--runstatedir=/run"
8187 # capability dropping, currently mostly for plugins as those get spawned as root
8288 # see auditd-plugins(5)
8389 "--with-libcap-ng=yes"
8490 ( if enablePython then "--with-python" else "--without-python" )
8591 ] ;
8692
93+ __structuredAttrs = true ;
94+
95+ # lib output is part of the mandatory nixos system closure, so avoid bash here
96+ outputChecks . lib . disallowedRequisites = [
97+ bash
98+ bashNonInteractive
99+ ] ;
100+
101+ postInstall = ''
102+ installShellCompletion --bash init.d/audit.bash_completion
103+ '' ;
104+
87105 enableParallelBuilding = true ;
88106
89107 passthru = {
@@ -98,7 +116,7 @@ stdenv.mkDerivation (finalAttrs: {
98116 meta = {
99117 homepage = "https://people.redhat.com/sgrubb/audit/" ;
100118 description = "Audit Library" ;
101- changelog = "https://github.com/linux-audit/audit-userspace/releases/tag/v ${ finalAttrs . version } " ;
119+ changelog = "https://github.com/linux-audit/audit-userspace/releases/tag/v4.1.1 " ;
102120 license = lib . licenses . gpl2Plus ;
103121 maintainers = with lib . maintainers ; [ grimmauld ] ;
104122 pkgConfigModules = [
0 commit comments