diff options
Diffstat (limited to 'pkgs/servers/shishi/default.nix')
-rw-r--r-- | pkgs/servers/shishi/default.nix | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/servers/shishi/default.nix b/pkgs/servers/shishi/default.nix index bc4e57ba116c..a97e6847a450 100644 --- a/pkgs/servers/shishi/default.nix +++ b/pkgs/servers/shishi/default.nix @@ -5,8 +5,16 @@ , pam ? null, libidn ? null, gnutls ? null }: -with stdenv; let + mkFlag = trueStr: falseStr: cond: name: val: + if cond == null then null else + "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}"; + mkEnable = mkFlag "enable-" "disable-"; + mkWith = mkFlag "with-" "without-"; + mkOther = mkFlag "" "" true; + + shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null; + optPam = shouldUsePkg pam; optLibidn = shouldUsePkg libidn; optGnutls = shouldUsePkg gnutls; |