Skip to content

Commit

Permalink
pkgsStatic.openssh: fix build (NixOS#278079)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksanaa authored Oct 29, 2024
2 parents d2f71c7 + e4eea83 commit b166978
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkgs/tools/networking/openssh/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@
, libxcrypt
, hostname
, nixosTests
, withFIDO ? stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isMusl
, withSecurityKey ? !stdenv.hostPlatform.isStatic
, withFIDO ? stdenv.hostPlatform.isUnix && !stdenv.hostPlatform.isMusl && withSecurityKey
, withPAM ? stdenv.hostPlatform.isLinux
, dsaKeysSupport ? false
, linkOpenssl ? true
, isNixos ? stdenv.hostPlatform.isLinux
}:

# FIDO support requires SK support
assert withFIDO -> withSecurityKey;

stdenv.mkDerivation (finalAttrs: {
inherit pname version src;

Expand Down Expand Up @@ -103,14 +107,17 @@ stdenv.mkDerivation (finalAttrs: {
(lib.withFeature withPAM "pam")
(lib.enableFeature dsaKeysSupport "dsa-keys")
] ++ lib.optional (etcDir != null) "--sysconfdir=${etcDir}"
++ lib.optional (!withSecurityKey) "--disable-security-key"
++ lib.optional withFIDO "--with-security-key-builtin=yes"
++ lib.optional withKerberos (assert krb5 != null; "--with-kerberos5=${lib.getDev krb5}")
++ lib.optional stdenv.hostPlatform.isDarwin "--disable-libutil"
++ lib.optional (!linkOpenssl) "--without-openssl"
++ lib.optional withLdns "--with-ldns"
++ extraConfigureFlags;

${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null}= [ "-laudit" ] ++ lib.optionals withKerberos [ "-lkeyutils" ];
${if stdenv.hostPlatform.isStatic then "NIX_LDFLAGS" else null} = [ "-laudit" ]
++ lib.optional withKerberos "-lkeyutils"
++ lib.optional withLdns "-lcrypto";

buildFlags = [ "SSH_KEYSIGN=ssh-keysign" ];

Expand Down

0 comments on commit b166978

Please sign in to comment.