summary refs log tree commit diff
path: root/pkgs/os-specific/linux/systemd
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-10-27 23:48:19 +0100
committerFlorian Klink <flokli@flokli.de>2020-10-28 23:24:17 +0100
commite1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49 (patch)
treeb4aecfe7843c37b9c46d7199c53dc31cbc6e29dc /pkgs/os-specific/linux/systemd
parent39e733336cc0841dca9a869b4527f33b49c80ea4 (diff)
downloadnixpkgs-e1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49.tar
nixpkgs-e1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49.tar.gz
nixpkgs-e1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49.tar.bz2
nixpkgs-e1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49.tar.lz
nixpkgs-e1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49.tar.xz
nixpkgs-e1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49.tar.zst
nixpkgs-e1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49.zip
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.
Diffstat (limited to 'pkgs/os-specific/linux/systemd')
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix23
1 files changed, 14 insertions, 9 deletions
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index 665b330aa9e..4a501e8872b 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -55,17 +55,18 @@
 , kexectools
 , bashInteractive
 
-, withResolved ? true
-, withLogind ? true
+, withCryptsetup ? true
+, withEfi ? stdenv.hostPlatform.isEfi
 , withHostnamed ? true
+, withHwdb ? true
+, withImportd ? true
 , withLocaled ? true
+, withLogind ? true
 , withNetworkd ? true
+, withRemote ? false  # has always been disabled on NixOS, upstream version appears broken anyway
+, withResolved ? true
 , withTimedated ? true
 , withTimesyncd ? true
-, withHwdb ? true
-, withEfi ? stdenv.hostPlatform.isEfi
-, withImportd ? true
-, withCryptsetup ? true
 
   # name argument
 , pname ? "systemd"
@@ -82,9 +83,13 @@ assert withImportd ->
 (curl.dev != null && zlib != null && xz != null && libgcrypt != null
   && gnutar != null && gnupg != null);
 
+assert withRemote -> lib.getDev curl != null;
+
 assert withCryptsetup ->
 (cryptsetup != null);
 let
+  wantCurl = withRemote || withImportd;
+
   version = "246.6";
 in
 stdenv.mkDerivation {
@@ -165,7 +170,6 @@ stdenv.mkDerivation {
       audit
       bzip2
       cryptsetup
-      curl.dev
       glib
       kmod
       libapparmor
@@ -181,6 +185,7 @@ stdenv.mkDerivation {
       pcre2
       xz
     ]
+    ++ lib.optional wantCurl (lib.getDev curl)
     ++ lib.optional withNetworkd iptables
     ++ lib.optional withKexectools kexectools
     ++ lib.optional withLibseccomp libseccomp
@@ -216,7 +221,7 @@ stdenv.mkDerivation {
     "-Dcryptsetup=${lib.boolToString withCryptsetup}"
     "-Dportabled=false"
     "-Dhwdb=${lib.boolToString withHwdb}"
-    "-Dremote=false"
+    "-Dremote=${lib.boolToString withRemote}"
     "-Dsysusers=false"
     "-Dtimedated=${lib.boolToString withTimedated}"
     "-Dtimesyncd=${lib.boolToString withTimesyncd}"
@@ -224,7 +229,7 @@ stdenv.mkDerivation {
     "-Dlocaled=true"
     "-Dresolve=${lib.boolToString withResolved}"
     "-Dsplit-usr=false"
-    "-Dlibcurl=true"
+    "-Dlibcurl=${lib.boolToString wantCurl}"
     "-Dlibidn=false"
     "-Dlibidn2=true"
     "-Dquotacheck=false"