systemd: add withRemote option (default to false), make curl optional

This makes curl optional if both remote and importd are disabled, and
makes some assertions more robust by switching from curl.dev != null to
lib.getDev curl != null.
This commit is contained in:
Florian Klink 2020-10-27 23:48:19 +01:00
parent 39e733336c
commit e1e01fa85e
1 changed files with 14 additions and 9 deletions

View File

@ -55,17 +55,18 @@
, kexectools , kexectools
, bashInteractive , bashInteractive
, withResolved ? true , withCryptsetup ? true
, withLogind ? true , withEfi ? stdenv.hostPlatform.isEfi
, withHostnamed ? true , withHostnamed ? true
, withHwdb ? true
, withImportd ? true
, withLocaled ? true , withLocaled ? true
, withLogind ? true
, withNetworkd ? true , withNetworkd ? true
, withRemote ? false # has always been disabled on NixOS, upstream version appears broken anyway
, withResolved ? true
, withTimedated ? true , withTimedated ? true
, withTimesyncd ? true , withTimesyncd ? true
, withHwdb ? true
, withEfi ? stdenv.hostPlatform.isEfi
, withImportd ? true
, withCryptsetup ? true
# name argument # name argument
, pname ? "systemd" , pname ? "systemd"
@ -82,9 +83,13 @@ assert withImportd ->
(curl.dev != null && zlib != null && xz != null && libgcrypt != null (curl.dev != null && zlib != null && xz != null && libgcrypt != null
&& gnutar != null && gnupg != null); && gnutar != null && gnupg != null);
assert withRemote -> lib.getDev curl != null;
assert withCryptsetup -> assert withCryptsetup ->
(cryptsetup != null); (cryptsetup != null);
let let
wantCurl = withRemote || withImportd;
version = "246.6"; version = "246.6";
in in
stdenv.mkDerivation { stdenv.mkDerivation {
@ -165,7 +170,6 @@ stdenv.mkDerivation {
audit audit
bzip2 bzip2
cryptsetup cryptsetup
curl.dev
glib glib
kmod kmod
libapparmor libapparmor
@ -181,6 +185,7 @@ stdenv.mkDerivation {
pcre2 pcre2
xz xz
] ]
++ lib.optional wantCurl (lib.getDev curl)
++ lib.optional withNetworkd iptables ++ lib.optional withNetworkd iptables
++ lib.optional withKexectools kexectools ++ lib.optional withKexectools kexectools
++ lib.optional withLibseccomp libseccomp ++ lib.optional withLibseccomp libseccomp
@ -216,7 +221,7 @@ stdenv.mkDerivation {
"-Dcryptsetup=${lib.boolToString withCryptsetup}" "-Dcryptsetup=${lib.boolToString withCryptsetup}"
"-Dportabled=false" "-Dportabled=false"
"-Dhwdb=${lib.boolToString withHwdb}" "-Dhwdb=${lib.boolToString withHwdb}"
"-Dremote=false" "-Dremote=${lib.boolToString withRemote}"
"-Dsysusers=false" "-Dsysusers=false"
"-Dtimedated=${lib.boolToString withTimedated}" "-Dtimedated=${lib.boolToString withTimedated}"
"-Dtimesyncd=${lib.boolToString withTimesyncd}" "-Dtimesyncd=${lib.boolToString withTimesyncd}"
@ -224,7 +229,7 @@ stdenv.mkDerivation {
"-Dlocaled=true" "-Dlocaled=true"
"-Dresolve=${lib.boolToString withResolved}" "-Dresolve=${lib.boolToString withResolved}"
"-Dsplit-usr=false" "-Dsplit-usr=false"
"-Dlibcurl=true" "-Dlibcurl=${lib.boolToString wantCurl}"
"-Dlibidn=false" "-Dlibidn=false"
"-Dlibidn2=true" "-Dlibidn2=true"
"-Dquotacheck=false" "-Dquotacheck=false"