diff --git a/pkgs/tools/networking/stunnel/default.nix b/pkgs/tools/networking/stunnel/default.nix index 244dd3bbcdc0..ee408e7c2373 100644 --- a/pkgs/tools/networking/stunnel/default.nix +++ b/pkgs/tools/networking/stunnel/default.nix @@ -1,4 +1,8 @@ -{ lib, stdenv, fetchurl, openssl, nixosTests }: +{ lib, stdenv, fetchurl, openssl +, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd +, nixosTests +}: + stdenv.mkDerivation rec { pname = "stunnel"; @@ -11,11 +15,17 @@ stdenv.mkDerivation rec { # not the output of `nix-prefetch-url` }; - buildInputs = [ openssl ]; + buildInputs = [ + openssl + ] ++ lib.optionals systemdSupport [ + systemd + ]; + configureFlags = [ "--with-ssl=${openssl.dev}" "--sysconfdir=/etc" "--localstatedir=/var" + (lib.enableFeature systemdSupport "systemd") ]; postInstall = ''