From 6fda4f93ee26114d10d3a9869f1018812638be3f Mon Sep 17 00:00:00 2001 From: nikstur Date: Sun, 27 Jul 2025 21:18:57 +0200 Subject: [PATCH] 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 --- pkgs/by-name/li/linux-pam/package.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pkgs/by-name/li/linux-pam/package.nix b/pkgs/by-name/li/linux-pam/package.nix index 3d41329f2701..5cc358a92025 100644 --- a/pkgs/by-name/li/linux-pam/package.nix +++ b/pkgs/by-name/li/linux-pam/package.nix @@ -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)