nixos/pam: replace apparmor warnings with assertions (#332119)

This commit is contained in:
Colin 2024-12-04 19:06:22 +00:00 committed by GitHub
commit ca5f6df0c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1668,13 +1668,11 @@ in
(lib.concatMap lib.attrValues)
(lib.filter (rule: rule.enable))
(lib.catAttrs "modulePath")
# TODO(@uninsane): replace this warning + lib.filter with just an assertion
(map (modulePath: lib.warnIfNot
(map (modulePath: lib.throwIfNot
(lib.hasPrefix "/" modulePath)
''non-absolute PAM modulePath "${modulePath}" is unsupported by apparmor and will be treated as an error by future versions of nixpkgs; see <https://github.com/NixOS/nixpkgs/pull/314791>''
''non-absolute PAM modulePath "${modulePath}" is unsupported by apparmor''
modulePath
))
(lib.filter (lib.hasPrefix "/"))
lib.unique
(map (module: "mr ${module},"))
concatLines