linux-pam: move scripts to separate output

This enables us to use the lib and out output without pulling in bash.

- Enable structuredAttrs
- Enable strictDeps
- Add bash to disallowedRequisites
This commit is contained in:
nikstur
2025-08-10 20:31:06 +02:00
parent da89a2d075
commit 6fda4f93ee
+19
View File
@@ -9,6 +9,8 @@
ninja,
audit,
libxcrypt,
bash,
bashNonInteractive,
nixosTests,
meson,
pkg-config,
@@ -31,8 +33,11 @@ stdenv.mkDerivation (finalAttrs: {
repo = "linux-pam";
tag = "v${finalAttrs.version}";
hash = "sha256-kANcwxifQz2tYPSrSBSFiYNTm51Gr10L/zroCqm8ZHQ=";
};
__structuredAttrs = true;
# patching unix_chkpwd is required as the nix store entry does not have the necessary bits
postPatch = ''
substituteInPlace modules/module-meson.build \
@@ -43,9 +48,12 @@ stdenv.mkDerivation (finalAttrs: {
"out"
"doc"
"man"
"scripts"
# "modules"
];
strictDeps = true;
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [
flex
@@ -65,6 +73,7 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
db4
libxcrypt
bash
]
++ lib.optionals stdenv.buildPlatform.isLinux [
audit
@@ -89,8 +98,18 @@ stdenv.mkDerivation (finalAttrs: {
(lib.mesonBool "examples" false)
];
postInstall = ''
moveToOutput sbin/pam_namespace_helper $scripts
moveToOutput etc/security/namespace.init $scripts
'';
doCheck = false; # fails
outputChecks.out.disallowedRequisites = [
bash
bashNonInteractive
];
passthru = {
tests = {
inherit (nixosTests)