From c6bbc945b4286681f23cafa16e63fd560dd8cfae Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 27 Oct 2020 23:20:54 +0100 Subject: [PATCH 01/28] systemd: stdenv.lib -> lib This is a no-op and makes things a bit smaller. --- pkgs/os-specific/linux/systemd/default.nix | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index ffb6da3c057..6ded933e280 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -122,12 +122,12 @@ in stdenv.mkDerivation { [ linuxHeaders libcap curl.dev kmod xz pam acl cryptsetup libuuid glib libgcrypt libgpgerror libidn2 pcre2 ] ++ - stdenv.lib.optional withKexectools kexectools ++ - stdenv.lib.optional withLibseccomp libseccomp ++ + lib.optional withKexectools kexectools ++ + lib.optional withLibseccomp libseccomp ++ [ libffi audit lz4 bzip2 libapparmor iptables ] ++ - stdenv.lib.optional withEfi gnu-efi ++ - stdenv.lib.optional withSelinux libselinux ++ - stdenv.lib.optional withCryptsetup cryptsetup.dev; + lib.optional withEfi gnu-efi ++ + lib.optional withSelinux libselinux ++ + lib.optional withCryptsetup cryptsetup.dev; #dontAddPrefix = true; @@ -143,26 +143,26 @@ in stdenv.mkDerivation { "-Dsetfont-path=${kbd}/bin/setfont" "-Dtty-gid=3" # tty in NixOS has gid 3 "-Ddebug-shell=${bashInteractive}/bin/bash" - "-Dglib=${stdenv.lib.boolToString (glib != null)}" + "-Dglib=${lib.boolToString (glib != null)}" # while we do not run tests we should also not build them. Removes about 600 targets "-Dtests=false" - "-Dimportd=${stdenv.lib.boolToString withImportd}" + "-Dimportd=${lib.boolToString withImportd}" "-Dlz4=true" "-Dhomed=false" - "-Dlogind=${stdenv.lib.boolToString withLogind}" - "-Dlocaled=${stdenv.lib.boolToString withLocaled}" - "-Dhostnamed=${stdenv.lib.boolToString withHostnamed}" - "-Dnetworkd=${stdenv.lib.boolToString withNetworkd}" - "-Dcryptsetup=${stdenv.lib.boolToString withCryptsetup}" + "-Dlogind=${lib.boolToString withLogind}" + "-Dlocaled=${lib.boolToString withLocaled}" + "-Dhostnamed=${lib.boolToString withHostnamed}" + "-Dnetworkd=${lib.boolToString withNetworkd}" + "-Dcryptsetup=${lib.boolToString withCryptsetup}" "-Dportabled=false" - "-Dhwdb=${stdenv.lib.boolToString withHwdb}" + "-Dhwdb=${lib.boolToString withHwdb}" "-Dremote=false" "-Dsysusers=false" - "-Dtimedated=${stdenv.lib.boolToString withTimedated}" - "-Dtimesyncd=${stdenv.lib.boolToString withTimesyncd}" + "-Dtimedated=${lib.boolToString withTimedated}" + "-Dtimesyncd=${lib.boolToString withTimesyncd}" "-Dfirstboot=false" "-Dlocaled=true" - "-Dresolve=${stdenv.lib.boolToString withResolved}" + "-Dresolve=${lib.boolToString withResolved}" "-Dsplit-usr=false" "-Dlibcurl=true" "-Dlibidn=false" @@ -201,8 +201,8 @@ in stdenv.mkDerivation { # more frequent development builds "-Dman=true" - "-Dgnu-efi=${stdenv.lib.boolToString (withEfi && gnu-efi != null)}" - ] ++ stdenv.lib.optionals (withEfi && gnu-efi != null) [ + "-Dgnu-efi=${lib.boolToString (withEfi && gnu-efi != null)}" + ] ++ lib.optionals (withEfi && gnu-efi != null) [ "-Defi-libdir=${toString gnu-efi}/lib" "-Defi-includedir=${toString gnu-efi}/include/efi" "-Defi-ldsdir=${toString gnu-efi}/lib" @@ -323,7 +323,7 @@ in stdenv.mkDerivation { # runtime; otherwise we can't and we need to reboot. passthru.interfaceVersion = 2; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://www.freedesktop.org/wiki/Software/systemd/"; description = "A system and service manager for Linux"; license = licenses.lgpl21Plus; From 229184f6b53bae4fe6f9f05abd36bb6184d87f6a Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 27 Oct 2020 23:23:41 +0100 Subject: [PATCH 02/28] systemd: reorder buildInputs These are all unconditianally anyways. --- pkgs/os-specific/linux/systemd/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 6ded933e280..e0e124aed31 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -121,10 +121,9 @@ in stdenv.mkDerivation { buildInputs = [ linuxHeaders libcap curl.dev kmod xz pam acl cryptsetup libuuid glib libgcrypt libgpgerror libidn2 - pcre2 ] ++ + pcre2 libffi audit lz4 bzip2 libapparmor iptables ] ++ lib.optional withKexectools kexectools ++ lib.optional withLibseccomp libseccomp ++ - [ libffi audit lz4 bzip2 libapparmor iptables ] ++ lib.optional withEfi gnu-efi ++ lib.optional withSelinux libselinux ++ lib.optional withCryptsetup cryptsetup.dev; From 6456e24d570728bc81fa8b070c5e34f83c7425f0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 27 Oct 2020 23:28:29 +0100 Subject: [PATCH 03/28] systemd: nixpkgs-fmt --- pkgs/os-specific/linux/systemd/default.nix | 139 +++++++++++++++------ 1 file changed, 102 insertions(+), 37 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index e0e124aed31..36eda6d2a87 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -1,28 +1,59 @@ -{ stdenv, lib, fetchFromGitHub +{ stdenv +, lib +, fetchFromGitHub , buildPackages -, ninja, meson, m4, pkgconfig, coreutils, gperf, getent -, patchelf, perl, glibcLocales, glib, substituteAll -, gettext, python3Packages +, ninja +, meson +, m4 +, pkgconfig +, coreutils +, gperf +, getent +, patchelf +, perl +, glibcLocales +, glib +, substituteAll +, gettext +, python3Packages -# Mandatory dependencies + # Mandatory dependencies , libcap , utillinux , kbd , kmod -# Optional dependencies -, pam, cryptsetup, lvm2, audit, acl -, lz4, libgcrypt, libgpgerror, libidn2 -, curl, gnutar, gnupg, zlib -, xz, libuuid, libffi -, libapparmor, intltool -, bzip2, pcre2, e2fsprogs + # Optional dependencies +, pam +, cryptsetup +, lvm2 +, audit +, acl +, lz4 +, libgcrypt +, libgpgerror +, libidn2 +, curl +, gnutar +, gnupg +, zlib +, xz +, libuuid +, libffi +, libapparmor +, intltool +, bzip2 +, pcre2 +, e2fsprogs , linuxHeaders ? stdenv.cc.libc.linuxHeaders , gnu-efi , iptables -, withSelinux ? false, libselinux -, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp -, withKexectools ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) kexectools.meta.platforms, kexectools +, withSelinux ? false +, libselinux +, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms +, libseccomp +, withKexectools ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) kexectools.meta.platforms +, kexectools , bashInteractive , withResolved ? true @@ -37,24 +68,27 @@ , withImportd ? true , withCryptsetup ? true -# name argument + # name argument , pname ? "systemd" -, libxslt, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45 +, libxslt +, docbook_xsl +, docbook_xml_dtd_42 +, docbook_xml_dtd_45 }: assert withResolved -> (libgcrypt != null && libgpgerror != null); assert withImportd -> - ( curl.dev != null && zlib != null && xz != null && libgcrypt != null +(curl.dev != null && zlib != null && xz != null && libgcrypt != null && gnutar != null && gnupg != null); assert withCryptsetup -> - ( cryptsetup != null ); - +(cryptsetup != null); let version = "246.6"; -in stdenv.mkDerivation { +in +stdenv.mkDerivation { inherit version pname; # We use systemd/systemd-stable for src, and ship NixOS-specific patches inside nixpkgs directly @@ -105,28 +139,56 @@ in stdenv.mkDerivation { outputs = [ "out" "man" "dev" ]; nativeBuildInputs = - [ pkgconfig gperf - ninja meson + [ + pkgconfig + gperf + ninja + meson coreutils # meson calls date, stat etc. glibcLocales - patchelf getent m4 + patchelf + getent + m4 perl # to patch the libsystemd.so and remove dependencies on aarch64 intltool gettext - libxslt docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45 - (buildPackages.python3Packages.python.withPackages ( ps: with ps; [ python3Packages.lxml ])) + libxslt + docbook_xsl + docbook_xml_dtd_42 + docbook_xml_dtd_45 + (buildPackages.python3Packages.python.withPackages (ps: with ps; [ python3Packages.lxml ])) ]; + buildInputs = - [ linuxHeaders libcap curl.dev kmod xz pam acl - cryptsetup libuuid glib libgcrypt libgpgerror libidn2 - pcre2 libffi audit lz4 bzip2 libapparmor iptables ] ++ - lib.optional withKexectools kexectools ++ - lib.optional withLibseccomp libseccomp ++ - lib.optional withEfi gnu-efi ++ - lib.optional withSelinux libselinux ++ - lib.optional withCryptsetup cryptsetup.dev; + [ + acl + audit + bzip2 + cryptsetup + curl.dev + glib + iptables + kmod + libapparmor + libcap + libffi + libgcrypt + libgpgerror + libidn2 + libuuid + linuxHeaders + lz4 + pam + pcre2 + xz + ] ++ lib.optional withKexectools kexectools + ++ lib.optional withLibseccomp libseccomp + ++ lib.optional withEfi gnu-efi + ++ lib.optional withSelinux libselinux + ++ lib.optional withCryptsetup cryptsetup.dev + ; #dontAddPrefix = true; @@ -271,14 +333,17 @@ in stdenv.mkDerivation { NIX_CFLAGS_COMPILE = toString [ # Can't say ${polkit.bin}/bin/pkttyagent here because that would # lead to a cyclic dependency. - "-UPOLKIT_AGENT_BINARY_PATH" "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\"" + "-UPOLKIT_AGENT_BINARY_PATH" + "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\"" # Set the release_agent on /sys/fs/cgroup/systemd to the # currently running systemd (/run/current-system/systemd) so # that we don't use an obsolete/garbage-collected release agent. - "-USYSTEMD_CGROUP_AGENT_PATH" "-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\"" + "-USYSTEMD_CGROUP_AGENT_PATH" + "-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\"" - "-USYSTEMD_BINARY_PATH" "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\"" + "-USYSTEMD_BINARY_PATH" + "-DSYSTEMD_BINARY_PATH=\"/run/current-system/systemd/lib/systemd/systemd\"" ]; doCheck = false; # fails a bunch of tests From 8434da57154823b06889257f81a5fa44aeb84dc4 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 27 Oct 2020 23:30:32 +0100 Subject: [PATCH 04/28] systemd: remove perl from nativeBuildInputs This was only used to patch a circular output reference from lib to out on aarch64, but was removed in b68bddfbda2092c5fde2c4cece2f4bcf0eb214a1, This commit forgot to remove perl, so remove it now. --- pkgs/os-specific/linux/systemd/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 36eda6d2a87..6ecfe26edef 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -10,7 +10,6 @@ , gperf , getent , patchelf -, perl , glibcLocales , glib , substituteAll @@ -149,7 +148,6 @@ stdenv.mkDerivation { patchelf getent m4 - perl # to patch the libsystemd.so and remove dependencies on aarch64 intltool gettext From 39e733336cc0841dca9a869b4527f33b49c80ea4 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 27 Oct 2020 23:37:01 +0100 Subject: [PATCH 05/28] systemd: build without iptables when networkd is disabled upstreams TODO mentions iptables-dev (libiptc) is also used for nspawn, but it seems like it only makes use of this via networkd anyways (or does these days) - at least systemdMinimal compiles successfully without iptables in the build closure. --- pkgs/os-specific/linux/systemd/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 6ecfe26edef..665b330aa9e 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -167,7 +167,6 @@ stdenv.mkDerivation { cryptsetup curl.dev glib - iptables kmod libapparmor libcap @@ -181,7 +180,9 @@ stdenv.mkDerivation { pam pcre2 xz - ] ++ lib.optional withKexectools kexectools + ] + ++ lib.optional withNetworkd iptables + ++ lib.optional withKexectools kexectools ++ lib.optional withLibseccomp libseccomp ++ lib.optional withEfi gnu-efi ++ lib.optional withSelinux libselinux From e1e01fa85e1a8cd5e4b6a0fa0cdaf51115d6eb49 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 27 Oct 2020 23:48:19 +0100 Subject: [PATCH 06/28] 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. --- pkgs/os-specific/linux/systemd/default.nix | 23 +++++++++++++--------- 1 file 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" From 5f257d7d2cd66cd5bcf832245e6d2734e2798381 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 27 Oct 2020 23:52:28 +0100 Subject: [PATCH 07/28] systemd: cleanup cryptsetup input use lib.getDev to retrieve the dev output. Don't pass it to buildInputs if we don't build with withCryptsetup set to true. --- pkgs/os-specific/linux/systemd/default.nix | 3 +-- pkgs/top-level/all-packages.nix | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 4a501e8872b..4b64c8d523e 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -169,7 +169,6 @@ stdenv.mkDerivation { acl audit bzip2 - cryptsetup glib kmod libapparmor @@ -191,7 +190,7 @@ stdenv.mkDerivation { ++ lib.optional withLibseccomp libseccomp ++ lib.optional withEfi gnu-efi ++ lib.optional withSelinux libselinux - ++ lib.optional withCryptsetup cryptsetup.dev + ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev) ; #dontAddPrefix = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fd5facef827..456b43a9c1e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18671,7 +18671,6 @@ in withEfi = false; withImportd = false; withCryptsetup = false; - cryptsetup = null; glib = null; lvm2 = null; }; From ff07c6b47d770ef110e7f2e6d8fc35ae020681e5 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:02:24 +0100 Subject: [PATCH 08/28] systemd: introduce withCompression flag This will build systemd without some compression utils, useful for systemdMinimal. --- pkgs/os-specific/linux/systemd/default.nix | 9 ++++----- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 4b64c8d523e..f9c12ca9b86 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -55,6 +55,7 @@ , kexectools , bashInteractive +, withCompression ? true # adds bzip2, lz4 and xz , withCryptsetup ? true , withEfi ? stdenv.hostPlatform.isEfi , withHostnamed ? true @@ -81,7 +82,7 @@ assert withResolved -> (libgcrypt != null && libgpgerror != null); assert withImportd -> (curl.dev != null && zlib != null && xz != null && libgcrypt != null - && gnutar != null && gnupg != null); + && gnutar != null && gnupg != null && withCompression ); assert withRemote -> lib.getDev curl != null; @@ -168,7 +169,6 @@ stdenv.mkDerivation { [ acl audit - bzip2 glib kmod libapparmor @@ -179,12 +179,11 @@ stdenv.mkDerivation { libidn2 libuuid linuxHeaders - lz4 pam pcre2 - xz ] ++ lib.optional wantCurl (lib.getDev curl) + ++ lib.optionals withCompression [ bzip2 lz4 xz ] ++ lib.optional withNetworkd iptables ++ lib.optional withKexectools kexectools ++ lib.optional withLibseccomp libseccomp @@ -211,7 +210,7 @@ stdenv.mkDerivation { # while we do not run tests we should also not build them. Removes about 600 targets "-Dtests=false" "-Dimportd=${lib.boolToString withImportd}" - "-Dlz4=true" + "-Dlz4=${lib.boolToString withCompression}" "-Dhomed=false" "-Dlogind=${lib.boolToString withLogind}" "-Dlocaled=${lib.boolToString withLocaled}" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 456b43a9c1e..6d2eb4253d8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18670,6 +18670,7 @@ in withHwdb = false; withEfi = false; withImportd = false; + withCompression = false; withCryptsetup = false; glib = null; lvm2 = null; From c6aada2835d91573f4572aa078fb353bf4dd69e0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:03:10 +0100 Subject: [PATCH 09/28] =?UTF-8?q?systemd:=20drop=20duplicate=20-Dlocaled?= =?UTF-8?q?=3D=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is already configurable above. --- pkgs/os-specific/linux/systemd/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index f9c12ca9b86..be21219b7d9 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -224,7 +224,6 @@ stdenv.mkDerivation { "-Dtimedated=${lib.boolToString withTimedated}" "-Dtimesyncd=${lib.boolToString withTimesyncd}" "-Dfirstboot=false" - "-Dlocaled=true" "-Dresolve=${lib.boolToString withResolved}" "-Dsplit-usr=false" "-Dlibcurl=${lib.boolToString wantCurl}" From 8d18be9cdc9efbeee1c017ae6c7e884de386948f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:04:54 +0100 Subject: [PATCH 10/28] systemdMinimal: sort feature flags --- pkgs/top-level/all-packages.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d2eb4253d8..f5276178f76 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18662,16 +18662,16 @@ in }; systemdMinimal = systemd.override { pname = "systemd-minimal"; - withResolved = false; - withLogind = false; - withHostnamed = false; - withLocaled = false; - withTimedated = false; - withHwdb = false; - withEfi = false; - withImportd = false; withCompression = false; withCryptsetup = false; + withEfi = false; + withHostnamed = false; + withHwdb = false; + withImportd = false; + withLocaled = false; + withLogind = false; + withResolved = false; + withTimedated = false; glib = null; lvm2 = null; }; From b027cf264c1a3e6a3e5974dce988bced95560368 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:12:27 +0100 Subject: [PATCH 11/28] systemdMinimal: disable networkd This was missed. --- pkgs/top-level/all-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f5276178f76..860674cf118 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18670,6 +18670,7 @@ in withImportd = false; withLocaled = false; withLogind = false; + withNetworkd = false; withResolved = false; withTimedated = false; glib = null; From 987906aa5861a56437975fa8c09cb92f354de631 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:12:45 +0100 Subject: [PATCH 12/28] systemd: add withCoredump flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … and default it to false for systemdMinimal --- pkgs/os-specific/linux/systemd/default.nix | 3 +++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 4 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index be21219b7d9..7e2d457bcfa 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -55,6 +55,7 @@ , kexectools , bashInteractive +, withCoredump ? true , withCompression ? true # adds bzip2, lz4 and xz , withCryptsetup ? true , withEfi ? stdenv.hostPlatform.isEfi @@ -85,6 +86,7 @@ assert withImportd -> && gnutar != null && gnupg != null && withCompression ); assert withRemote -> lib.getDev curl != null; +assert withCoredump -> withCompression; assert withCryptsetup -> (cryptsetup != null); @@ -223,6 +225,7 @@ stdenv.mkDerivation { "-Dsysusers=false" "-Dtimedated=${lib.boolToString withTimedated}" "-Dtimesyncd=${lib.boolToString withTimesyncd}" + "-Dcoredump=${lib.boolToString withCoredump}" "-Dfirstboot=false" "-Dresolve=${lib.boolToString withResolved}" "-Dsplit-usr=false" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 860674cf118..e802a6d403b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18663,6 +18663,7 @@ in systemdMinimal = systemd.override { pname = "systemd-minimal"; withCompression = false; + withCoredump = false; withCryptsetup = false; withEfi = false; withHostnamed = false; From 585f4a140b40959733903ab6fcba3ee2b5586af7 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:29:07 +0100 Subject: [PATCH 13/28] systemd: add withAnalyze flag --- pkgs/os-specific/linux/systemd/default.nix | 2 ++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 7e2d457bcfa..e5d4e0e1402 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -55,6 +55,7 @@ , kexectools , bashInteractive +, withAnalyze ? true , withCoredump ? true , withCompression ? true # adds bzip2, lz4 and xz , withCryptsetup ? true @@ -211,6 +212,7 @@ stdenv.mkDerivation { "-Dglib=${lib.boolToString (glib != null)}" # while we do not run tests we should also not build them. Removes about 600 targets "-Dtests=false" + "-Danalyze=${lib.boolToString withAnalyze}" "-Dimportd=${lib.boolToString withImportd}" "-Dlz4=${lib.boolToString withCompression}" "-Dhomed=false" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e802a6d403b..1c45d22b418 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18662,6 +18662,7 @@ in }; systemdMinimal = systemd.override { pname = "systemd-minimal"; + withAnalyze = false; withCompression = false; withCoredump = false; withCryptsetup = false; From 13a910e3f6e50ff3d1946e75cce6fde64656bba0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:29:34 +0100 Subject: [PATCH 14/28] systemd: make gcrypt optional --- pkgs/os-specific/linux/systemd/default.nix | 1 + pkgs/top-level/all-packages.nix | 1 + 2 files changed, 2 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index e5d4e0e1402..09b828f5875 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -213,6 +213,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)}" "-Dimportd=${lib.boolToString withImportd}" "-Dlz4=${lib.boolToString withCompression}" "-Dhomed=false" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1c45d22b418..ee0d9d80934 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18676,6 +18676,7 @@ in withResolved = false; withTimedated = false; glib = null; + libgcrypt = null; lvm2 = null; }; From 54c35f0940921ad43b49686f18e80634ff62d306 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:33:26 +0100 Subject: [PATCH 15/28] systemd: withEfi: move gnu-efi check into assertion --- pkgs/os-specific/linux/systemd/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 09b828f5875..e4c07baeecc 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -86,6 +86,7 @@ assert withImportd -> (curl.dev != null && zlib != null && xz != null && libgcrypt != null && gnutar != null && gnupg != null && withCompression ); +assert withEfi -> (gnu-efi != null); assert withRemote -> lib.getDev curl != null; assert withCoredump -> withCompression; @@ -269,8 +270,8 @@ stdenv.mkDerivation { # more frequent development builds "-Dman=true" - "-Dgnu-efi=${lib.boolToString (withEfi && gnu-efi != null)}" - ] ++ lib.optionals (withEfi && gnu-efi != null) [ + "-Dgnu-efi=${lib.boolToString withEfi}" + ] ++ lib.optionals withEfi [ "-Defi-libdir=${toString gnu-efi}/lib" "-Defi-includedir=${toString gnu-efi}/include/efi" "-Defi-ldsdir=${toString gnu-efi}/lib" From 0b762c02ee2a0a7a047c8ff5d2a1885ae04d4553 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:35:00 +0100 Subject: [PATCH 16/28] systemd: disable efi if we don't build with withEfi is set to false --- pkgs/os-specific/linux/systemd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index e4c07baeecc..21ac8208155 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -270,6 +270,7 @@ stdenv.mkDerivation { # more frequent development builds "-Dman=true" + "-Defi=${lib.boolToString withEfi}" "-Dgnu-efi=${lib.boolToString withEfi}" ] ++ lib.optionals withEfi [ "-Defi-libdir=${toString gnu-efi}/lib" From 1f9347431c153ffa3b61e0677782678bfce4bae3 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:48:51 +0100 Subject: [PATCH 17/28] systemd: add withPolkit option --- pkgs/os-specific/linux/systemd/default.nix | 2 ++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 21ac8208155..e8a38bce882 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -66,6 +66,7 @@ , withLocaled ? true , withLogind ? true , withNetworkd ? true +, withPolkit ? true , withRemote ? false # has always been disabled on NixOS, upstream version appears broken anyway , withResolved ? true , withTimedated ? true @@ -222,6 +223,7 @@ stdenv.mkDerivation { "-Dlocaled=${lib.boolToString withLocaled}" "-Dhostnamed=${lib.boolToString withHostnamed}" "-Dnetworkd=${lib.boolToString withNetworkd}" + "-Dpolkit=${lib.boolToString withPolkit}" "-Dcryptsetup=${lib.boolToString withCryptsetup}" "-Dportabled=false" "-Dhwdb=${lib.boolToString withHwdb}" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ee0d9d80934..d308ac7015c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18673,6 +18673,7 @@ in withLocaled = false; withLogind = false; withNetworkd = false; + withPolkit = false; withResolved = false; withTimedated = false; glib = null; From f142493a6a4e2ef9851884d482d14fba1de375a6 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:51:39 +0100 Subject: [PATCH 18/28] systemd: add withShellCompletions flag --- pkgs/os-specific/linux/systemd/default.nix | 4 ++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 5 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index e8a38bce882..49279c4b578 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -69,6 +69,7 @@ , withPolkit ? true , withRemote ? false # has always been disabled on NixOS, upstream version appears broken anyway , withResolved ? true +, withShellCompletions ? true , withTimedated ? true , withTimesyncd ? true @@ -278,6 +279,9 @@ stdenv.mkDerivation { "-Defi-libdir=${toString gnu-efi}/lib" "-Defi-includedir=${toString gnu-efi}/include/efi" "-Defi-ldsdir=${toString gnu-efi}/lib" + ] ++ lib.optionals (withShellCompletions == false) [ + "-Dbashcompletiondir=no" + "-Dzshcompletiondir=no" ]; preConfigure = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d308ac7015c..760deb47013 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18675,6 +18675,7 @@ in withNetworkd = false; withPolkit = false; withResolved = false; + withShellCompletions = false; withTimedated = false; glib = null; libgcrypt = null; From e77326208e0ce78492366a9c6c5b21d591047b0c Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 00:54:08 +0100 Subject: [PATCH 19/28] systemd: add withDocumentation flag --- pkgs/os-specific/linux/systemd/default.nix | 5 ++++- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 49279c4b578..4d5a5121a45 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -59,6 +59,7 @@ , withCoredump ? true , withCompression ? true # adds bzip2, lz4 and xz , withCryptsetup ? true +, withDocumentation ? true , withEfi ? stdenv.hostPlatform.isEfi , withHostnamed ? true , withHwdb ? true @@ -390,7 +391,9 @@ stdenv.mkDerivation { # "kernel-install" shouldn't be used on NixOS. find $out -name "*kernel-install*" -exec rm {} \; - ''; # */ + '' + lib.optionalString (!withDocumentation) '' + rm -rf $out/share/doc + ''; enableParallelBuilding = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 760deb47013..48ec0679fc6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18666,6 +18666,7 @@ in withCompression = false; withCoredump = false; withCryptsetup = false; + withDocumentation = false; withEfi = false; withHostnamed = false; withHwdb = false; From a079a6f02697d4d5d12c6627136f425cd7da5598 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:00:44 +0100 Subject: [PATCH 20/28] systemd: add withUserDb flag --- pkgs/os-specific/linux/systemd/default.nix | 2 ++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 4d5a5121a45..cd0968b4218 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -73,6 +73,7 @@ , withShellCompletions ? true , withTimedated ? true , withTimesyncd ? true +, withUserDb ? true # name argument , pname ? "systemd" @@ -233,6 +234,7 @@ stdenv.mkDerivation { "-Dsysusers=false" "-Dtimedated=${lib.boolToString withTimedated}" "-Dtimesyncd=${lib.boolToString withTimesyncd}" + "-Duserdb=${lib.boolToString withUserDb}" "-Dcoredump=${lib.boolToString withCoredump}" "-Dfirstboot=false" "-Dresolve=${lib.boolToString withResolved}" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 48ec0679fc6..00462f38c19 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18678,6 +18678,7 @@ in withResolved = false; withShellCompletions = false; withTimedated = false; + withUserDb = false; glib = null; libgcrypt = null; lvm2 = null; From 8526662a33beee8b344ec668c02529ee5b5cfbb5 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:05:14 +0100 Subject: [PATCH 21/28] systemd: add withNss flag --- pkgs/os-specific/linux/systemd/default.nix | 6 ++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 7 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index cd0968b4218..90df8a57ff1 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -67,6 +67,7 @@ , withLocaled ? true , withLogind ? true , withNetworkd ? true +, withNss ? true , withPolkit ? true , withRemote ? false # has always been disabled on NixOS, upstream version appears broken anyway , withResolved ? true @@ -285,6 +286,11 @@ stdenv.mkDerivation { ] ++ lib.optionals (withShellCompletions == false) [ "-Dbashcompletiondir=no" "-Dzshcompletiondir=no" + ] ++ lib.optionals (!withNss) [ + "-Dnss-myhostname=false" + "-Dnss-mymachines=false" + "-Dnss-resolve=false" + "-Dnss-systemd=false" ]; preConfigure = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 00462f38c19..e2e83dc103f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18674,6 +18674,7 @@ in withLocaled = false; withLogind = false; withNetworkd = false; + withNss = false; withPolkit = false; withResolved = false; withShellCompletions = false; From e10a9a850602fc7f3044c845ab61de18a4315b74 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:08:29 +0100 Subject: [PATCH 22/28] systemd: add withMachined flag --- pkgs/os-specific/linux/systemd/default.nix | 2 ++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 3 insertions(+) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 90df8a57ff1..59c9451debe 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -66,6 +66,7 @@ , withImportd ? true , withLocaled ? true , withLogind ? true +, withMachined ? true , withNetworkd ? true , withNss ? true , withPolkit ? true @@ -226,6 +227,7 @@ stdenv.mkDerivation { "-Dlogind=${lib.boolToString withLogind}" "-Dlocaled=${lib.boolToString withLocaled}" "-Dhostnamed=${lib.boolToString withHostnamed}" + "-Dmachined=${lib.boolToString withMachined}" "-Dnetworkd=${lib.boolToString withNetworkd}" "-Dpolkit=${lib.boolToString withPolkit}" "-Dcryptsetup=${lib.boolToString withCryptsetup}" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e2e83dc103f..5a23b7ba9cf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18673,6 +18673,7 @@ in withImportd = false; withLocaled = false; withLogind = false; + withMachined = false; withNetworkd = false; withNss = false; withPolkit = false; From 961663a1b3236be22e7a22592ff8c51d2f0af3c9 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:09:44 +0100 Subject: [PATCH 23/28] systemdMinimal: disable timesyncd --- pkgs/top-level/all-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5a23b7ba9cf..3af884f5edc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18680,6 +18680,7 @@ in withResolved = false; withShellCompletions = false; withTimedated = false; + withTimesyncd = false; withUserDb = false; glib = null; libgcrypt = null; From e6dff1d666d6645828f4381882540d1512a76b9e Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:17:30 +0100 Subject: [PATCH 24/28] systemd: drop libffi from buildInputs This isn't used anywhere. --- pkgs/os-specific/linux/systemd/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 59c9451debe..1df3c8ab2ee 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -38,7 +38,6 @@ , zlib , xz , libuuid -, libffi , libapparmor , intltool , bzip2 @@ -183,7 +182,6 @@ stdenv.mkDerivation { kmod libapparmor libcap - libffi libgcrypt libgpgerror libidn2 From 065f057d0c2286fc0dc1c7b92b5d9f2929d97866 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:22:23 +0100 Subject: [PATCH 25/28] systemd: add libgpgerror only to buildInputs if we build with resolved support --- pkgs/os-specific/linux/systemd/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 1df3c8ab2ee..b608ae72ffc 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -183,7 +183,6 @@ stdenv.mkDerivation { libapparmor libcap libgcrypt - libgpgerror libidn2 libuuid linuxHeaders @@ -192,13 +191,14 @@ stdenv.mkDerivation { ] ++ lib.optional wantCurl (lib.getDev curl) ++ lib.optionals withCompression [ bzip2 lz4 xz ] - ++ lib.optional withNetworkd iptables + ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev) + ++ lib.optional withEfi gnu-efi ++ lib.optional withKexectools kexectools ++ lib.optional withLibseccomp libseccomp - ++ lib.optional withEfi gnu-efi + ++ lib.optional withNetworkd iptables + ++ lib.optional withResolved libgpgerror ++ lib.optional withSelinux libselinux - ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev) - ; + ; #dontAddPrefix = true; From 93dcbbf69d778e0cea16eaa010d68cc55526d5b0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:26:24 +0100 Subject: [PATCH 26/28] systemd: add withApparmor option --- pkgs/os-specific/linux/systemd/default.nix | 3 ++- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index b608ae72ffc..9c1b1fee7c8 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -55,6 +55,7 @@ , bashInteractive , withAnalyze ? true +, withApparmor ? true , withCoredump ? true , withCompression ? true # adds bzip2, lz4 and xz , withCryptsetup ? true @@ -180,7 +181,6 @@ stdenv.mkDerivation { audit glib kmod - libapparmor libcap libgcrypt libidn2 @@ -189,6 +189,7 @@ stdenv.mkDerivation { pam pcre2 ] + ++ lib.optional withApparmor libapparmor ++ lib.optional wantCurl (lib.getDev curl) ++ lib.optionals withCompression [ bzip2 lz4 xz ] ++ lib.optional withCryptsetup (lib.getDev cryptsetup.dev) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3af884f5edc..0f7610cad46 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18663,6 +18663,7 @@ in systemdMinimal = systemd.override { pname = "systemd-minimal"; withAnalyze = false; + withApparmor = false; withCompression = false; withCoredump = false; withCryptsetup = false; From 959cea2e8096b69901a4d48b9352b39aaf8e7545 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:36:02 +0100 Subject: [PATCH 27/28] systemd: add withPCRE2 option --- pkgs/os-specific/linux/systemd/default.nix | 4 +++- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 9c1b1fee7c8..7327e9065e5 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -69,6 +69,7 @@ , withMachined ? true , withNetworkd ? true , withNss ? true +, withPCRE2 ? true , withPolkit ? true , withRemote ? false # has always been disabled on NixOS, upstream version appears broken anyway , withResolved ? true @@ -187,8 +188,8 @@ stdenv.mkDerivation { libuuid linuxHeaders pam - pcre2 ] + ++ lib.optional withApparmor libapparmor ++ lib.optional wantCurl (lib.getDev curl) ++ lib.optionals withCompression [ bzip2 lz4 xz ] @@ -197,6 +198,7 @@ stdenv.mkDerivation { ++ lib.optional withKexectools kexectools ++ lib.optional withLibseccomp libseccomp ++ lib.optional withNetworkd iptables + ++ lib.optional withPCRE2 pcre2 ++ lib.optional withResolved libgpgerror ++ lib.optional withSelinux libselinux ; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0f7610cad46..a663714db31 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18677,6 +18677,7 @@ in withMachined = false; withNetworkd = false; withNss = false; + withPCRE2 = false; withPolkit = false; withResolved = false; withShellCompletions = false; From 6dbc23e75ddcf3f462f6a8b30f1ceea0a06c1403 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 28 Oct 2020 01:48:23 +0100 Subject: [PATCH 28/28] systemd: stop substituting inside fsck.c, stop substituting mke2fs fsck.c doesn't refer to any of these binaries anymore, and the whole systmed codebase not to /sbin/mke2fs. --- pkgs/os-specific/linux/systemd/default.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 7327e9065e5..8aaeddd1e81 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -305,7 +305,6 @@ stdenv.mkDerivation { src/core/mount.c \ src/core/swap.c \ src/cryptsetup/cryptsetup-generator.c \ - src/fsck/fsck.c \ src/journal/cat.c \ src/nspawn/nspawn.c \ src/remount-fs/remount-fs.c \ @@ -322,8 +321,6 @@ stdenv.mkDerivation { --replace /sbin/mkswap ${lib.getBin utillinux}/sbin/mkswap \ --replace /sbin/swapon ${lib.getBin utillinux}/sbin/swapon \ --replace /sbin/swapoff ${lib.getBin utillinux}/sbin/swapoff \ - --replace /sbin/mke2fs ${lib.getBin e2fsprogs}/sbin/mke2fs \ - --replace /sbin/fsck ${lib.getBin utillinux}/sbin/fsck \ --replace /bin/echo ${coreutils}/bin/echo \ --replace /bin/cat ${coreutils}/bin/cat \ --replace /sbin/sulogin ${lib.getBin utillinux}/sbin/sulogin \