From 3ceeae830d42e7857981d11ad251c4f39e2fdd4b Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sun, 12 Dec 2021 15:49:40 +0100 Subject: [PATCH] systemdMinimal: don't set {libfido2,p11-kit,libgcrypt} to null We don't have to do that as we already set all the feature flags to null. Setting individual libraries to null instead of disabling their feature flag will lead with bad example that will cause each of the features to be disabled with multiple flags in the systemdMinimal variant. If a dependency is pulled in via another feature we should disable that rather than setting it to null. Overriding a given package should be the last resort. --- pkgs/os-specific/linux/systemd/default.nix | 8 ++++---- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 95782d2c0754..c1217510813b 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -61,6 +61,8 @@ , kexec-tools , bashInteractive , libmicrohttpd +, libfido2 +, p11-kit # the (optional) BPF feature requires bpftool, libbpf, clang and llmv-strip to be avilable during build time. # Only libbpf should be a runtime dependency. @@ -97,8 +99,6 @@ , withTimesyncd ? true , withTpm2Tss ? !stdenv.hostPlatform.isMusl , withUserDb ? !stdenv.hostPlatform.isMusl -, libfido2 -, p11-kit # name argument , pname ? "systemd" @@ -373,13 +373,13 @@ stdenv.mkDerivation { glib kmod libcap - libgcrypt libidn2 libuuid linuxHeaders pam ] + ++ lib.optional wantGcrypt libgcrypt ++ lib.optional withApparmor libapparmor ++ lib.optional wantCurl (lib.getDev curl) ++ lib.optionals withCompression [ bzip2 lz4 xz zstd ] @@ -418,7 +418,7 @@ stdenv.mkDerivation { # while we do not run tests we should also not build them. Removes about 600 targets "-Dtests=false" "-Danalyze=${lib.boolToString withAnalyze}" - "-Dgcrypt=${lib.boolToString (libgcrypt != null)}" + "-Dgcrypt=${lib.boolToString wantGcrypt}" "-Dimportd=${lib.boolToString withImportd}" "-Dlz4=${lib.boolToString withCompression}" "-Dhomed=${lib.boolToString withHomed}" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 06857eb515a7..c56a7ed533a6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23233,10 +23233,8 @@ with pkgs; withTpm2Tss = false; withUserDb = false; glib = null; - libgcrypt = null; + lvm2 = null; - libfido2 = null; - p11-kit = null; };