about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-06-27 18:00:49 -0700
committerArtturin <Artturin@artturin.com>2023-08-28 20:38:32 +0300
commit49add44e4dd93514339ff2d732596b441be31a09 (patch)
tree58959d2c1c9df01f4d68895cd4e4889e433ddac9
parent4a1b19a0524ed640f69a0e4d1ff8ca96e1f9bba9 (diff)
openssh: add withPAM parameter
-rw-r--r--pkgs/tools/networking/openssh/common.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/tools/networking/openssh/common.nix b/pkgs/tools/networking/openssh/common.nix
index f3028573c05c0..18a268752a59e 100644
--- a/pkgs/tools/networking/openssh/common.nix
+++ b/pkgs/tools/networking/openssh/common.nix
@@ -26,6 +26,7 @@
 , hostname
 , nixosTests
 , withFIDO ? stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isMusl
+, withPAM ? stdenv.hostPlatform.isLinux
 , linkOpenssl ? true
 }:
 
@@ -61,7 +62,7 @@ stdenv.mkDerivation {
   buildInputs = [ zlib openssl libedit ]
     ++ lib.optional withFIDO libfido2
     ++ lib.optional withKerberos libkrb5
-    ++ lib.optional stdenv.isLinux pam;
+    ++ lib.optional withPAM pam;
 
   preConfigure = ''
     # Setting LD causes `configure' and `make' to disagree about which linker
@@ -78,7 +79,7 @@ stdenv.mkDerivation {
     "--with-mantype=man"
     "--with-libedit=yes"
     "--disable-strip"
-    (if stdenv.isLinux then "--with-pam" else "--without-pam")
+    (lib.withFeature withPAM "pam")
   ] ++ lib.optional (etcDir != null) "--sysconfdir=${etcDir}"
     ++ lib.optional withFIDO "--with-security-key-builtin=yes"
     ++ lib.optional withKerberos (assert libkrb5 != null; "--with-kerberos5=${libkrb5}")