From 72db02ec9e21bc89b2263421019b26288540bce2 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:33:45 +0800 Subject: [PATCH 01/67] kernel: add perl to moduleBuildDependencies --- pkgs/os-specific/linux/kernel/manual-config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 4f12337c893f..1ac9cbe00ead 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -56,7 +56,7 @@ let hasAttr getAttr optional optionals optionalString optionalAttrs maintainers platforms; # Dependencies that are required to build kernel modules - moduleBuildDependencies = optional (lib.versionAtLeast version "4.14") libelf; + moduleBuildDependencies = [ perl ] ++ optional (lib.versionAtLeast version "4.14") libelf; installkernel = writeTextFile { name = "installkernel"; executable=true; text = '' From bd8917e7ea45e7250be96232ccfd5609e8e040c8 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:34:22 +0800 Subject: [PATCH 02/67] cryptodev: pass moduleBuildDependencies from kernel --- pkgs/os-specific/linux/cryptodev/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/os-specific/linux/cryptodev/default.nix b/pkgs/os-specific/linux/cryptodev/default.nix index f09679ba2128..cc3a1d81109e 100644 --- a/pkgs/os-specific/linux/cryptodev/default.nix +++ b/pkgs/os-specific/linux/cryptodev/default.nix @@ -11,6 +11,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-vJQ10rG5FGbeEOqCUmH/pZ0P77kAW/MtUarywbtIyHw="; }; + nativeBuildInputs = kernel.moduleBuildDependencies; hardeningDisable = [ "pic" ]; KERNEL_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; From 2bd89d95c61ba1cb0162ab773c323ce803197e64 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:34:31 +0800 Subject: [PATCH 03/67] akvcam: pass makeFlags and moduleBuildDependencies from kernel --- pkgs/os-specific/linux/akvcam/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/akvcam/default.nix b/pkgs/os-specific/linux/akvcam/default.nix index 700389a4a183..0724118431ce 100644 --- a/pkgs/os-specific/linux/akvcam/default.nix +++ b/pkgs/os-specific/linux/akvcam/default.nix @@ -12,7 +12,8 @@ stdenv.mkDerivation rec { }; sourceRoot = "source/src"; - makeFlags = [ + nativeBuildInputs = kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags ++ [ "KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; From 07b06a72741c1c3965e75adf3c434b6969e93792 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:35:56 +0800 Subject: [PATCH 04/67] apfs: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/apfs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/apfs/default.nix b/pkgs/os-specific/linux/apfs/default.nix index 62437d662b92..98fd83ed5d51 100644 --- a/pkgs/os-specific/linux/apfs/default.nix +++ b/pkgs/os-specific/linux/apfs/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { hardeningDisable = [ "pic" ]; nativeBuildInputs = kernel.moduleBuildDependencies; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "KERNELRELEASE=${kernel.modDirVersion}" "KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" From 8d715c1f78a0e4797171418ca27b800b0f268afa Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:40:50 +0800 Subject: [PATCH 05/67] batman_adv: prepend kernel.makeFlags to makeFLags --- pkgs/os-specific/linux/batman-adv/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/batman-adv/default.nix b/pkgs/os-specific/linux/batman-adv/default.nix index 354f4b1bff2c..123c42e83971 100644 --- a/pkgs/os-specific/linux/batman-adv/default.nix +++ b/pkgs/os-specific/linux/batman-adv/default.nix @@ -12,11 +12,13 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags ++ [ + "KERNELPATH=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; hardeningDisable = [ "pic" ]; preBuild = '' - makeFlags="KERNELPATH=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" sed -i -e "s,INSTALL_MOD_DIR=,INSTALL_MOD_PATH=$out INSTALL_MOD_DIR=," \ -e /depmod/d Makefile ''; From fba1f47f001f653086ee73a068882b865603e8f8 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:43:54 +0800 Subject: [PATCH 06/67] can-isotop: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/can-isotp/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/can-isotp/default.nix b/pkgs/os-specific/linux/can-isotp/default.nix index 9c30aae86fe8..8119f99deb77 100644 --- a/pkgs/os-specific/linux/can-isotp/default.nix +++ b/pkgs/os-specific/linux/can-isotp/default.nix @@ -12,16 +12,17 @@ stdenv.mkDerivation { rev = "21a3a59e2bfad246782896841e7af042382fcae7"; sha256 = "1laax93czalclg7cy9iq1r7hfh9jigh7igj06y9lski75ap2vhfq"; }; - - KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; - INSTALL_MOD_PATH = "\${out}"; + makeFlags = kernel.makeFlags ++ [ + "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "INSTALL_MOD_PATH=${placeholder "out"}" + ]; buildPhase = '' - make modules + make modules $makeFlags ''; installPhase = '' - make modules_install + make modules_install $makeFlags ''; nativeBuildInputs = kernel.moduleBuildDependencies; From 98bd4307a60172e92b12cbc03f6f4efaaca423f9 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:46:11 +0800 Subject: [PATCH 07/67] digimend: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/digimend/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/digimend/default.nix b/pkgs/os-specific/linux/digimend/default.nix index 6b5f66f825bd..e26509d3a7cb 100644 --- a/pkgs/os-specific/linux/digimend/default.nix +++ b/pkgs/os-specific/linux/digimend/default.nix @@ -13,8 +13,6 @@ stdenv.mkDerivation rec { sha256 = "1l54j85540386a8aypqka7p5hy1b63cwmpsscv9rmmf10f78v8mm"; }; - INSTALL_MOD_PATH = "\${out}"; - postPatch = '' sed 's/udevadm /true /' -i Makefile sed 's/depmod /true /' -i Makefile @@ -38,10 +36,11 @@ stdenv.mkDerivation rec { rm -r $out/lib/udev ''; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "KVERSION=${kernel.modDirVersion}" "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "DESTDIR=${placeholder "out"}" + "INSTALL_MOD_PATH=${placeholder "out"}" ]; meta = with lib; { From 694eef94d79a6bd6170f0109c22f8e6d8e6f0938 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:51:58 +0800 Subject: [PATCH 08/67] dpdk-kmods: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/dpdk-kmods/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/dpdk-kmods/default.nix b/pkgs/os-specific/linux/dpdk-kmods/default.nix index a188336cbe50..694e508dcd01 100644 --- a/pkgs/os-specific/linux/dpdk-kmods/default.nix +++ b/pkgs/os-specific/linux/dpdk-kmods/default.nix @@ -11,6 +11,9 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; + makeFlags = kernel.makeFlags ++ [ + "INSTALL_MOD_PATH=${placeholder "out"}" + ]; KSRC = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; nativeBuildInputs = kernel.moduleBuildDependencies; @@ -18,10 +21,9 @@ stdenv.mkDerivation rec { preBuild = "cd linux/igb_uio"; installPhase = '' - make -C ${KSRC} M=$(pwd) modules_install + make -C ${KSRC} M=$(pwd) modules_install $makeFlags ''; - INSTALL_MOD_PATH = placeholder "out"; enableParallelBuilding = true; meta = with lib; { From 07d1ce68d4259717c0458b6244de4887473a6b8e Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:55:51 +0800 Subject: [PATCH 09/67] ena: pass makeFlags from kernel --- pkgs/os-specific/linux/ena/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/ena/default.nix b/pkgs/os-specific/linux/ena/default.nix index 1257217a5206..5873a2fe2c1d 100644 --- a/pkgs/os-specific/linux/ena/default.nix +++ b/pkgs/os-specific/linux/ena/default.nix @@ -14,6 +14,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; nativeBuildInputs = kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags; # linux 3.12 NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; @@ -27,7 +28,7 @@ stdenv.mkDerivation rec { installPhase = '' runHook preInstall - strip -S ena.ko + $STRIP -S ena.ko dest=$out/lib/modules/${kernel.modDirVersion}/misc mkdir -p $dest cp ena.ko $dest/ From 490bf9cae5d736c77b81b8288d0ce4ecf35d84ac Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:57:21 +0800 Subject: [PATCH 10/67] evdi: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/evdi/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/evdi/default.nix b/pkgs/os-specific/linux/evdi/default.nix index e40448be4353..721a49ed4a56 100644 --- a/pkgs/os-specific/linux/evdi/default.nix +++ b/pkgs/os-specific/linux/evdi/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [ kernel libdrm ]; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "KVER=${kernel.modDirVersion}" "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; From 77e2c0324cdcc23c998585cb8e7cd865e10f93fc Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 09:58:55 +0800 Subject: [PATCH 11/67] fwts-efi-runtime: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/fwts/module.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/fwts/module.nix b/pkgs/os-specific/linux/fwts/module.nix index 737d3316e21d..72f25aa800eb 100644 --- a/pkgs/os-specific/linux/fwts/module.nix +++ b/pkgs/os-specific/linux/fwts/module.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "INSTALL_MOD_PATH=${placeholder "out"}" ]; From 697e54e3e24b991e54c5a84f0702e16d731509b8 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:00:25 +0800 Subject: [PATCH 12/67] gcadapter-oc-kmod: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix b/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix index ab2e099d9708..bcea220cc96e 100644 --- a/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix +++ b/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix @@ -19,7 +19,7 @@ in stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "KERNEL_SOURCE_DIR=${kernel.dev}/${kerneldir}/build" "INSTALL_MOD_PATH=$(out)" ]; From 0341ed782c3794d9329c87a96120aaf71981e818 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:01:36 +0800 Subject: [PATCH 13/67] hid-nintendo: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/hid-nintendo/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/hid-nintendo/default.nix b/pkgs/os-specific/linux/hid-nintendo/default.nix index e9ee88252ea8..7d01120b2f3f 100644 --- a/pkgs/os-specific/linux/hid-nintendo/default.nix +++ b/pkgs/os-specific/linux/hid-nintendo/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "-C" "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "M=$(sourceRoot)" From fd5ead0eed11a41d44d9d8900e8cce62ee39d02b Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:12:55 +0800 Subject: [PATCH 14/67] jool: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/jool/default.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/jool/default.nix b/pkgs/os-specific/linux/jool/default.nix index 2fd10778e2cf..9246ca679a65 100644 --- a/pkgs/os-specific/linux/jool/default.nix +++ b/pkgs/os-specific/linux/jool/default.nix @@ -16,13 +16,12 @@ stdenv.mkDerivation { sed -e 's@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@' -i src/mod/*/Makefile ''; - buildPhase = '' - make -C src/mod - ''; + makeFlags = kernel.makeFlags ++ [ + "-C src/mod" + "INSTALL_MOD_PATH=${placeholder "out"}" + ]; - installPhase = '' - make -C src/mod modules_install INSTALL_MOD_PATH=$out - ''; + installTargets = "modules_install"; meta = with lib; { homepage = "https://www.jool.mx/"; From c35ec1c0317a43c90bd016cc6ca4868af1280f23 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:13:55 +0800 Subject: [PATCH 15/67] lttng-modules: prepend kernel.makeFlags to makeFlags, move moduleBuildDependencies to nativeBuildInputs --- pkgs/os-specific/linux/lttng-modules/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/lttng-modules/default.nix b/pkgs/os-specific/linux/lttng-modules/default.nix index 8753f34087cf..99ffb7756da0 100644 --- a/pkgs/os-specific/linux/lttng-modules/default.nix +++ b/pkgs/os-specific/linux/lttng-modules/default.nix @@ -9,16 +9,16 @@ stdenv.mkDerivation rec { sha256 = "0hzksx2fw008jdsgfzpws9g7imy6ryw09ai5y0knvrmvr68nvj57"; }; - buildInputs = kernel.moduleBuildDependencies; + nativeBuildInputs = kernel.moduleBuildDependencies; hardeningDisable = [ "pic" ]; NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; - preConfigure = '' - export KERNELDIR="${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" - export INSTALL_MOD_PATH="$out" - ''; + makeFlags = kernel.makeFlags ++ [ + "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "INSTALL_MOD_PATH=${placeholder "out"}" + ]; installTargets = [ "modules_install" ]; From e1f487741f8cfc5275bdc216f765d136e6bbb596 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:15:02 +0800 Subject: [PATCH 16/67] mba6x_bl: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/mba6x_bl/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/mba6x_bl/default.nix b/pkgs/os-specific/linux/mba6x_bl/default.nix index fe9c11ace1f6..04a89ad038dd 100644 --- a/pkgs/os-specific/linux/mba6x_bl/default.nix +++ b/pkgs/os-specific/linux/mba6x_bl/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { nativeBuildInputs = kernel.moduleBuildDependencies; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" ]; From 4315bccd6aade57303cd6345ed101e16e351fa2f Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:24:57 +0800 Subject: [PATCH 17/67] mbp2018-bridge-drv: pass makeFlags and moduleBuildDependencies from kernel --- .../linux/mbp-modules/mbp2018-bridge-drv/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/mbp-modules/mbp2018-bridge-drv/default.nix b/pkgs/os-specific/linux/mbp-modules/mbp2018-bridge-drv/default.nix index 070b4a6207e1..0b4fec4dfb4e 100644 --- a/pkgs/os-specific/linux/mbp-modules/mbp2018-bridge-drv/default.nix +++ b/pkgs/os-specific/linux/mbp-modules/mbp2018-bridge-drv/default.nix @@ -11,14 +11,17 @@ stdenv.mkDerivation rec { sha256 = "sha256-o6yGiR+Y5SnX1johdi7fQWP5ts7HdDMqeju75UOhgik="; }; + nativeBuildInputs = kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags; + buildPhase = '' make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \ - -j$NIX_BUILD_CORES M=$(pwd) modules + -j$NIX_BUILD_CORES M=$(pwd) modules $makeFlags ''; installPhase = '' make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \ - INSTALL_MOD_PATH=$out M=$(pwd) modules_install + INSTALL_MOD_PATH=$out M=$(pwd) modules_install $makeFlags ''; meta = with lib; { From 45e662bd95e6179428d51b5a5f7843213ebe4054 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:28:35 +0800 Subject: [PATCH 18/67] netatop: pass makeFlags and moduleBuildDependencies from kernel --- pkgs/os-specific/linux/netatop/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/os-specific/linux/netatop/default.nix b/pkgs/os-specific/linux/netatop/default.nix index 28f989929a4c..dec1399d1695 100644 --- a/pkgs/os-specific/linux/netatop/default.nix +++ b/pkgs/os-specific/linux/netatop/default.nix @@ -12,6 +12,7 @@ stdenv.mkDerivation { sha256 = "0qjw8glfdmngfvbn1w63q128vxdz2jlabw13y140ga9i5ibl6vvk"; }; + nativeBuildInputs = kernel.moduleBuildDependencies; buildInputs = [ kmod zlib ]; hardeningDisable = [ "pic" ]; @@ -36,6 +37,8 @@ stdenv.mkDerivation { kmod=${kmod} substituteAllInPlace netatop.service ''; + makeFlags = kernel.makeFlags; + preInstall = '' mkdir -p $out/lib/systemd/system $out/bin $out/sbin $out/share/man/man{4,8} mkdir -p $out/lib/modules/${kernel.modDirVersion}/extra From 03d4ac4e5b88d95b89e0c34dfd42b31fa9cd7abb Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:30:53 +0800 Subject: [PATCH 19/67] openrazer: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/openrazer/driver.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/openrazer/driver.nix b/pkgs/os-specific/linux/openrazer/driver.nix index 6e387de0719f..2de63580ac33 100644 --- a/pkgs/os-specific/linux/openrazer/driver.nix +++ b/pkgs/os-specific/linux/openrazer/driver.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation (common // { nativeBuildInputs = kernel.moduleBuildDependencies; - buildFlags = [ + makeFlags = kernel.makeFlags ++ [ "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; From 86ec7c438c563420375a729f43ad2ac9962efa66 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:38:29 +0800 Subject: [PATCH 20/67] xpadneo: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/xpadneo/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/xpadneo/default.nix b/pkgs/os-specific/linux/xpadneo/default.nix index c1874877620c..c5aa09a88608 100644 --- a/pkgs/os-specific/linux/xpadneo/default.nix +++ b/pkgs/os-specific/linux/xpadneo/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies; buildInputs = [ bluez ]; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "-C" "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "M=$(sourceRoot)" From 271699dcc56daa15a58d511b0c7865c1ca159b28 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:40:05 +0800 Subject: [PATCH 21/67] rtl88x2bu: pass makeFlags from kernel --- pkgs/os-specific/linux/rtl88x2bu/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/rtl88x2bu/default.nix b/pkgs/os-specific/linux/rtl88x2bu/default.nix index 31d8f50a5288..e092d145abd2 100644 --- a/pkgs/os-specific/linux/rtl88x2bu/default.nix +++ b/pkgs/os-specific/linux/rtl88x2bu/default.nix @@ -13,10 +13,10 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - nativeBuildInputs = [ bc ]; - buildInputs = kernel.moduleBuildDependencies; + nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags; - prePatch = '' + prePatch = '' substituteInPlace ./Makefile \ --replace /lib/modules/ "${kernel.dev}/lib/modules/" \ --replace '$(shell uname -r)' "${kernel.modDirVersion}" \ From f45eebdb7ecbb9c674aa29003fd6d44dca175d27 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:40:22 +0800 Subject: [PATCH 22/67] xmm7360-pci: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/xmm7360-pci/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/xmm7360-pci/default.nix b/pkgs/os-specific/linux/xmm7360-pci/default.nix index 6a589ff889c3..435ff94afb76 100644 --- a/pkgs/os-specific/linux/xmm7360-pci/default.nix +++ b/pkgs/os-specific/linux/xmm7360-pci/default.nix @@ -11,10 +11,12 @@ stdenv.mkDerivation rec { sha256 = "1wdb0phqg9rj9g9ycqdya0m7lx24kzjlh25yw0ifp898ddxrrr0c"; }; - makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; + makeFlags = kernel.makeFlags ++ [ + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "INSTALL_MOD_PATH=${placeholder "out"}" + ]; nativeBuildInputs = kernel.moduleBuildDependencies; - INSTALL_MOD_PATH = placeholder "out"; installFlags = [ "DEPMOD=true" ]; meta = with lib; { From e2c5168db4cd9e31596f88af110b89802fa6b35b Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:42:58 +0800 Subject: [PATCH 23/67] vhba: prepend kernel.makeFlags to makeFlags --- pkgs/applications/emulators/cdemu/vhba.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/emulators/cdemu/vhba.nix b/pkgs/applications/emulators/cdemu/vhba.nix index aeadcf5c1c1d..40792c81ac1c 100644 --- a/pkgs/applications/emulators/cdemu/vhba.nix +++ b/pkgs/applications/emulators/cdemu/vhba.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-csWowcRSgF5M74yv787MLSXOGXrkxnODCCgC5a3Nd7Y="; }; - makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" ]; + makeFlags = kernel.makeFlags ++ [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=$(out)" ]; nativeBuildInputs = kernel.moduleBuildDependencies; meta = with lib; { From d3943a84afc5a39eb3f7559d48b3fc31283a3af9 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:44:46 +0800 Subject: [PATCH 24/67] veikk-linux-driver: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/veikk-linux-driver/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/veikk-linux-driver/default.nix b/pkgs/os-specific/linux/veikk-linux-driver/default.nix index a1019d7b7fd6..8cf4896ae027 100644 --- a/pkgs/os-specific/linux/veikk-linux-driver/default.nix +++ b/pkgs/os-specific/linux/veikk-linux-driver/default.nix @@ -15,9 +15,9 @@ stdenv.mkDerivation rec { buildInputs = [ kernel ]; - buildPhase = '' - make BUILD_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build - ''; + makeFlags = kernel.makeFlags ++ [ + "BUILD_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; installPhase = '' mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/veikk From 0b302ffa47ed8c80ed8bb652ce3b77991aec7977 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:46:46 +0800 Subject: [PATCH 25/67] v4l2loopback: prepend kernel.makeFlags to makeFlags and some cleanup --- pkgs/os-specific/linux/v4l2loopback/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/v4l2loopback/default.nix b/pkgs/os-specific/linux/v4l2loopback/default.nix index c1aa7be2af6b..095d873e66cb 100644 --- a/pkgs/os-specific/linux/v4l2loopback/default.nix +++ b/pkgs/os-specific/linux/v4l2loopback/default.nix @@ -16,12 +16,9 @@ stdenv.mkDerivation rec { preBuild = '' substituteInPlace Makefile --replace "modules_install" "INSTALL_MOD_PATH=$out modules_install" sed -i '/depmod/d' Makefile - export PATH=${kmod}/sbin:$PATH ''; - nativeBuildInputs = kernel.moduleBuildDependencies; - - buildInputs = [ kmod ]; + nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies; postInstall = '' make install-utils PREFIX=$bin @@ -29,7 +26,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "bin" ]; - makeFlags = [ + makeFlags = kernel.makeFlags ++ [ "KERNELRELEASE=${kernel.modDirVersion}" "KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; From 123882b6aaf030cad964b0778fcaceeaca1328e7 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:52:31 +0800 Subject: [PATCH 26/67] rtw88: prepend kernel.makeFlags to makeFlags, pass moduleBuildDependencies --- pkgs/os-specific/linux/rtw88/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/rtw88/default.nix b/pkgs/os-specific/linux/rtw88/default.nix index c3f849df1181..529ee621892b 100644 --- a/pkgs/os-specific/linux/rtw88/default.nix +++ b/pkgs/os-specific/linux/rtw88/default.nix @@ -14,7 +14,8 @@ stdenv.mkDerivation { hash = "sha256-PRzWXC1lre8gt1GfVdnaG836f5YK57P9a8tG20yef0w="; }; - makeFlags = [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; + nativeBuildInputs = kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags ++ [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; enableParallelBuilding = true; From b046f22da2ff60f4943bca8ca8cba1dea8218bee Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:52:40 +0800 Subject: [PATCH 27/67] rtw89: prepend kernel.makeFlags to makeFlags, pass moduleBuildDependencies --- pkgs/os-specific/linux/rtw89/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/rtw89/default.nix b/pkgs/os-specific/linux/rtw89/default.nix index 6b0f06c5bdc4..6ff208fa6dd9 100644 --- a/pkgs/os-specific/linux/rtw89/default.nix +++ b/pkgs/os-specific/linux/rtw89/default.nix @@ -14,7 +14,8 @@ stdenv.mkDerivation { sha256 = "0cvawyi1ksw9xkr8pzwipsl7b8hnmrb17w5cblyicwih8fqaw632"; }; - makeFlags = [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; + nativeBuildInputs = kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags ++ [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; enableParallelBuilding = true; From 3f6359ac266b934dea50bf0269aa6794a3935895 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:55:00 +0800 Subject: [PATCH 28/67] rtl8821cu: pass makeFlags from kernel, move moduleBuildDependencies to nativeBuildInputs --- pkgs/os-specific/linux/rtl8821cu/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/rtl8821cu/default.nix b/pkgs/os-specific/linux/rtl8821cu/default.nix index 9229a3c13069..0ea0682214bf 100644 --- a/pkgs/os-specific/linux/rtl8821cu/default.nix +++ b/pkgs/os-specific/linux/rtl8821cu/default.nix @@ -13,8 +13,8 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - nativeBuildInputs = [ bc ]; - buildInputs = kernel.moduleBuildDependencies; + nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags; prePatch = '' substituteInPlace ./Makefile \ From e61b83cb60f202068e3a9809f9a363e794a60e19 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:56:52 +0800 Subject: [PATCH 29/67] rtl8821ce: pass makeFlags from kernel, move moduleBuildDependencies to nativeBuildInputs --- pkgs/os-specific/linux/rtl8821ce/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/rtl8821ce/default.nix b/pkgs/os-specific/linux/rtl8821ce/default.nix index 75e12a1b7a46..27303c029802 100644 --- a/pkgs/os-specific/linux/rtl8821ce/default.nix +++ b/pkgs/os-specific/linux/rtl8821ce/default.nix @@ -13,8 +13,8 @@ stdenv.mkDerivation rec { hardeningDisable = [ "pic" ]; - nativeBuildInputs = [ bc ]; - buildInputs = kernel.moduleBuildDependencies; + nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags; prePatch = '' substituteInPlace ./Makefile \ From a0f82198c7670619894b8ff21590d725b8b48639 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 10:59:27 +0800 Subject: [PATCH 30/67] rtl8814au: pass makeFlags from kernel, move moduleBuildDependencies to nativeBuildInputs --- pkgs/os-specific/linux/rtl8814au/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/rtl8814au/default.nix b/pkgs/os-specific/linux/rtl8814au/default.nix index f9ca60b1112b..f12adf73d5f3 100644 --- a/pkgs/os-specific/linux/rtl8814au/default.nix +++ b/pkgs/os-specific/linux/rtl8814au/default.nix @@ -11,7 +11,8 @@ stdenv.mkDerivation { sha256 = "0lk3ldff489ggbqmlfi4zvnp1cvxj1b06m0fhpzai82070klzzmj"; }; - buildInputs = kernel.moduleBuildDependencies; + nativeBuildInputs = kernel.moduleBuildDependencies; + makeFlags = kernel.makeFlags; hardeningDisable = [ "pic" ]; From c0ed14933fdd91c7e8999ecb940a503f13630cdf Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 13:27:42 +0800 Subject: [PATCH 31/67] r8168: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/r8168/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/r8168/default.nix b/pkgs/os-specific/linux/r8168/default.nix index 91e15db2eeb6..680cc531af42 100644 --- a/pkgs/os-specific/linux/r8168/default.nix +++ b/pkgs/os-specific/linux/r8168/default.nix @@ -27,11 +27,13 @@ in stdenv.mkDerivation rec { # avoid using the Makefile directly -- it doesn't understand # any kernel but the current. # based on the ArchLinux pkgbuild: https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/r8168 + makeFlags = kernel.makeFlags ++ [ + "-C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "M=$(PWD)/src" + "modules" + ]; preBuild = '' - makeFlagsArray+=("-C${kernel.dev}/lib/modules/${kernel.modDirVersion}/build") - makeFlagsArray+=("M=$PWD/src") makeFlagsArray+=("EXTRA_CFLAGS=-DCONFIG_R8168_NAPI -DCONFIG_R8168_VLAN -DCONFIG_ASPM -DENABLE_S5WOL -DENABLE_EEE") - makeFlagsArray+=("modules") ''; enableParallelBuilding = true; From 977b3b12ace5cdb7bac6e43a18579d6cb031c2a1 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 13:33:20 +0800 Subject: [PATCH 32/67] rtl8192eu: prepend kernel.makeFlags to makeFlags --- pkgs/os-specific/linux/rtl8192eu/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/rtl8192eu/default.nix b/pkgs/os-specific/linux/rtl8192eu/default.nix index b33330611b88..6fa15358582c 100644 --- a/pkgs/os-specific/linux/rtl8192eu/default.nix +++ b/pkgs/os-specific/linux/rtl8192eu/default.nix @@ -19,7 +19,7 @@ in stdenv.mkDerivation rec { nativeBuildInputs = kernel.moduleBuildDependencies ++ [ bc ]; - makeFlags = [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; + makeFlags = kernel.makeFlags ++ [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; enableParallelBuilding = true; From 364b75a8628050c159a9fb7e207de721489c4452 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 13:34:51 +0800 Subject: [PATCH 33/67] rtl8189es: 2020-10-03 -> 2021-10-01, move moduleBuildDependencies to nativeBuildInputs --- pkgs/os-specific/linux/rtl8189es/default.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pkgs/os-specific/linux/rtl8189es/default.nix b/pkgs/os-specific/linux/rtl8189es/default.nix index 500359f7e4fd..d6b5785210b0 100644 --- a/pkgs/os-specific/linux/rtl8189es/default.nix +++ b/pkgs/os-specific/linux/rtl8189es/default.nix @@ -2,17 +2,16 @@ stdenv.mkDerivation rec { name = "rtl8189es-${kernel.version}-${version}"; - version = "2020-10-03"; + version = "2021-10-01"; src = fetchFromGitHub { owner = "jwrdegoede"; repo = "rtl8189ES_linux"; - rev = "03ac413135a355b55b693154c44b70f86a39732e"; - sha256 = "0wiikviwyvy6h55rgdvy7csi1zqniqg26p8x44rd6mhbw0g00h56"; + rev = "be378f47055da1bae42ff6ec1d62f1a5052ef097"; + sha256 = "sha256-+19q1Xux2BjquavY+s0UDzTubEt6BEUZ9XVDVmj36us="; }; - nativeBuildInputs = [ bc nukeReferences ]; - buildInputs = kernel.moduleBuildDependencies; + nativeBuildInputs = [ bc nukeReferences ] ++ kernel.moduleBuildDependencies; hardeningDisable = [ "pic" "format" ]; @@ -23,13 +22,10 @@ stdenv.mkDerivation rec { substituteInPlace ./Makefile --replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" ''; - makeFlags = [ - "ARCH=${stdenv.hostPlatform.linuxArch}" + makeFlags = kernel.makeFlags ++ [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ("CONFIG_PLATFORM_I386_PC=" + (if (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) then "y" else "n")) ("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n")) - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ - "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; preInstall = '' From b0d43c3409b955a91d1920de120670fa97596ceb Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 10 Feb 2022 13:37:36 +0800 Subject: [PATCH 34/67] systemtap: move python and setuptools to nativeBuildInputs --- pkgs/development/tools/profiling/systemtap/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/profiling/systemtap/default.nix b/pkgs/development/tools/profiling/systemtap/default.nix index 31eafb1086b8..ac00e3418782 100644 --- a/pkgs/development/tools/profiling/systemtap/default.nix +++ b/pkgs/development/tools/profiling/systemtap/default.nix @@ -16,8 +16,8 @@ let pname = "systemtap"; inherit version; src = fetchgit { inherit url rev sha256; }; - nativeBuildInputs = [ pkg-config cpio ]; - buildInputs = [ elfutils gettext python3 python3.pkgs.setuptools ]; + nativeBuildInputs = [ pkg-config cpio python3 python3.pkgs.setuptools ]; + buildInputs = [ elfutils gettext ]; enableParallelBuilding = true; }; From cdfe6962e971314727c2b89d6bf9abadcf728c37 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 7 Mar 2022 12:34:45 +0800 Subject: [PATCH 35/67] can-isotp: make use of buildFlags and installTargets --- pkgs/os-specific/linux/can-isotp/default.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pkgs/os-specific/linux/can-isotp/default.nix b/pkgs/os-specific/linux/can-isotp/default.nix index 8119f99deb77..73edb3be9ec3 100644 --- a/pkgs/os-specific/linux/can-isotp/default.nix +++ b/pkgs/os-specific/linux/can-isotp/default.nix @@ -12,18 +12,14 @@ stdenv.mkDerivation { rev = "21a3a59e2bfad246782896841e7af042382fcae7"; sha256 = "1laax93czalclg7cy9iq1r7hfh9jigh7igj06y9lski75ap2vhfq"; }; + makeFlags = kernel.makeFlags ++ [ "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=${placeholder "out"}" ]; - buildPhase = '' - make modules $makeFlags - ''; - - installPhase = '' - make modules_install $makeFlags - ''; + buildFlags = [ "modules" ]; + installTargets = [ "modules_install" ]; nativeBuildInputs = kernel.moduleBuildDependencies; From 40a35299fa30421de85a56f084f6c59d05ea883e Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 9 Jan 2022 08:46:55 +0100 Subject: [PATCH 36/67] nixos: add functions and documentation for escaping systemd Exec* directives it's really easy to accidentally write the wrong systemd Exec* directive, ones that works most of the time but fails when users include systemd metacharacters in arguments that are interpolated into an Exec* directive. add a few functions analogous to escapeShellArg{,s} and some documentation on how and when to use them. --- .../development/writing-modules.chapter.md | 42 ++++++++++++++++ .../development/writing-modules.chapter.xml | 49 +++++++++++++++++++ nixos/lib/utils.nix | 20 ++++++++ nixos/tests/all-tests.nix | 1 + nixos/tests/empty-file | 0 nixos/tests/systemd-escaping.nix | 45 +++++++++++++++++ 6 files changed, 157 insertions(+) create mode 100644 nixos/tests/empty-file create mode 100644 nixos/tests/systemd-escaping.nix diff --git a/nixos/doc/manual/development/writing-modules.chapter.md b/nixos/doc/manual/development/writing-modules.chapter.md index 2e3c6b34f1f5..0c41cbd3cb75 100644 --- a/nixos/doc/manual/development/writing-modules.chapter.md +++ b/nixos/doc/manual/development/writing-modules.chapter.md @@ -90,6 +90,17 @@ modules: `systemd.services` (the set of all systemd services) and `systemd.timers` (the list of commands to be executed periodically by `systemd`). +Care must be taken when writing systemd services using `Exec*` directives. By +default systemd performs substitution on `%` specifiers in these +directives, expands environment variables from `$FOO` and `${FOO}`, splits +arguments on whitespace, and splits commands on `;`. All of these must be escaped +to avoid unexpected substitution or splitting when interpolating into an `Exec*` +directive, e.g. when using an `extraArgs` option to pass additional arguments to +the service. The functions `utils.escapeSystemdExecArg` and +`utils.escapeSystemdExecArgs` are provided for this, see [Example: Escaping in +Exec directives](#exec-escaping-example) for an example. When using these +functions system environment substitution should *not* be disabled explicitly. + ::: {#locate-example .example} ::: {.title} **Example: NixOS Module for the "locate" Service** @@ -153,6 +164,37 @@ in { ``` ::: +::: {#exec-escaping-example .example} +::: {.title} +**Example: Escaping in Exec directives** +::: +```nix +{ config, lib, pkgs, utils, ... }: + +with lib; + +let + cfg = config.services.echo; + echoAll = pkgs.writeScript "echo-all" '' + #! ${pkgs.runtimeShell} + for s in "$@"; do + printf '%s\n' "$s" + done + ''; + args = [ "a%Nything" "lang=\${LANG}" ";" "/bin/sh -c date" ]; +in { + systemd.services.echo = + { description = "Echo to the journal"; + wantedBy = [ "multi-user.target" ]; + serviceConfig.Type = "oneshot"; + serviceConfig.ExecStart = '' + ${echoAll} ${utils.escapeSystemdExecArgs args} + ''; + }; +} +``` +::: + ```{=docbook} diff --git a/nixos/doc/manual/from_md/development/writing-modules.chapter.xml b/nixos/doc/manual/from_md/development/writing-modules.chapter.xml index e33c24f4f12c..367731eda090 100644 --- a/nixos/doc/manual/from_md/development/writing-modules.chapter.xml +++ b/nixos/doc/manual/from_md/development/writing-modules.chapter.xml @@ -122,6 +122,25 @@ services) and systemd.timers (the list of commands to be executed periodically by systemd). + + Care must be taken when writing systemd services using + Exec* directives. By default systemd performs + substitution on %<char> specifiers in these + directives, expands environment variables from + $FOO and ${FOO}, splits + arguments on whitespace, and splits commands on + ;. All of these must be escaped to avoid + unexpected substitution or splitting when interpolating into an + Exec* directive, e.g. when using an + extraArgs option to pass additional arguments to + the service. The functions + utils.escapeSystemdExecArg and + utils.escapeSystemdExecArgs are provided for + this, see Example: Escaping in + Exec directives for an example. When using these functions + system environment substitution should not be + disabled explicitly. + Example: NixOS Module for the @@ -183,6 +202,36 @@ in { }; }; } + + + + Example: Escaping in Exec + directives + + +{ config, lib, pkgs, utils, ... }: + +with lib; + +let + cfg = config.services.echo; + echoAll = pkgs.writeScript "echo-all" '' + #! ${pkgs.runtimeShell} + for s in "$@"; do + printf '%s\n' "$s" + done + ''; + args = [ "a%Nything" "lang=\${LANG}" ";" "/bin/sh -c date" ]; +in { + systemd.services.echo = + { description = "Echo to the journal"; + wantedBy = [ "multi-user.target" ]; + serviceConfig.Type = "oneshot"; + serviceConfig.ExecStart = '' + ${echoAll} ${utils.escapeSystemdExecArgs args} + ''; + }; +} diff --git a/nixos/lib/utils.nix b/nixos/lib/utils.nix index bbebf8ba35a0..291350241954 100644 --- a/nixos/lib/utils.nix +++ b/nixos/lib/utils.nix @@ -45,6 +45,26 @@ rec { replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"] (removePrefix "/" s); + # Quotes an argument for use in Exec* service lines. + # systemd accepts "-quoted strings with escape sequences, toJSON produces + # a subset of these. + # Additionally we escape % to disallow expansion of % specifiers. Any lone ; + # in the input will be turned it ";" and thus lose its special meaning. + # Every $ is escaped to $$, this makes it unnecessary to disable environment + # substitution for the directive. + escapeSystemdExecArg = arg: + let + s = if builtins.isPath arg then "${arg}" + else if builtins.isString arg then arg + else if builtins.isInt arg || builtins.isFloat arg then toString arg + else throw "escapeSystemdExecArg only allows strings, paths and numbers"; + in + replaceChars [ "%" "$" ] [ "%%" "$$" ] (builtins.toJSON s); + + # Quotes a list of arguments into a single string for use in a Exec* + # line. + escapeSystemdExecArgs = concatMapStringsSep " " escapeSystemdExecArg; + # Returns a system path for a given shell package toShellPath = shell: if types.shellPackage.check shell then diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 9f3e97ceb13d..01708fe06792 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -459,6 +459,7 @@ in systemd-boot = handleTest ./systemd-boot.nix {}; systemd-confinement = handleTest ./systemd-confinement.nix {}; systemd-cryptenroll = handleTest ./systemd-cryptenroll.nix {}; + systemd-escaping = handleTest ./systemd-escaping.nix {}; systemd-journal = handleTest ./systemd-journal.nix {}; systemd-networkd = handleTest ./systemd-networkd.nix {}; systemd-networkd-dhcpserver = handleTest ./systemd-networkd-dhcpserver.nix {}; diff --git a/nixos/tests/empty-file b/nixos/tests/empty-file new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/nixos/tests/systemd-escaping.nix b/nixos/tests/systemd-escaping.nix new file mode 100644 index 000000000000..7f93eb5e4f70 --- /dev/null +++ b/nixos/tests/systemd-escaping.nix @@ -0,0 +1,45 @@ +import ./make-test-python.nix ({ pkgs, ... }: + +let + echoAll = pkgs.writeScript "echo-all" '' + #! ${pkgs.runtimeShell} + for s in "$@"; do + printf '%s\n' "$s" + done + ''; + # deliberately using a local empty file instead of pkgs.emptyFile to have + # a non-store path in the test + args = [ "a%Nything" "lang=\${LANG}" ";" "/bin/sh -c date" ./empty-file 4.2 23 ]; +in +{ + name = "systemd-escaping"; + + machine = { pkgs, lib, utils, ... }: { + systemd.services.echo = + assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ [] ])).success; + assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ {} ])).success; + assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ null ])).success; + assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ false ])).success; + assert !(builtins.tryEval (utils.escapeSystemdExecArgs [ (_:_) ])).success; + { description = "Echo to the journal"; + serviceConfig.Type = "oneshot"; + serviceConfig.ExecStart = '' + ${echoAll} ${utils.escapeSystemdExecArgs args} + ''; + }; + }; + + testScript = '' + machine.wait_for_unit("multi-user.target") + machine.succeed("systemctl start echo.service") + # skip the first 'Starting ...' line + logs = machine.succeed("journalctl -u echo.service -o cat").splitlines()[1:] + assert "a%Nything" == logs[0] + assert "lang=''${LANG}" == logs[1] + assert ";" == logs[2] + assert "/bin/sh -c date" == logs[3] + assert "/nix/store/ij3gw72f4n5z4dz6nnzl1731p9kmjbwr-empty-file" == logs[4] + assert "4.2" in logs[5] # toString produces extra fractional digits! + assert "23" == logs[6] + ''; +}) From 5f95fee80eff6b224af62488d5610a8f8c88c3bb Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 13 Mar 2022 03:14:41 +0000 Subject: [PATCH 37/67] python310Packages.pudb: 2022.1 -> 2022.1.1 --- pkgs/development/python-modules/pudb/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pudb/default.nix b/pkgs/development/python-modules/pudb/default.nix index 0ae60b381c64..4e5839f7feed 100644 --- a/pkgs/development/python-modules/pudb/default.nix +++ b/pkgs/development/python-modules/pudb/default.nix @@ -14,14 +14,14 @@ buildPythonPackage rec { pname = "pudb"; - version = "2022.1"; + version = "2022.1.1"; format = "setuptools"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "e827a4b489dcad561189535db6677becbf32164b2b44df00786eb2d5e00c587e"; + sha256 = "sha256-2zvdZkI8nSkHTBwsSfyyJL0Nbwgxn+0bTn6taDkUCD8="; }; propagatedBuildInputs = [ From e46bfadd6d089d4d3c830f4779172dca0b92a0ac Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sat, 12 Mar 2022 21:52:18 -0600 Subject: [PATCH 38/67] signal-desktop: 5.34.0 -> 5.35.0 --- .../networking/instant-messengers/signal-desktop/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix index 228627ec5c32..f76bac26dc18 100644 --- a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix @@ -24,7 +24,7 @@ let in stdenv.mkDerivation rec { pname = "signal-desktop"; - version = "5.34.0"; # Please backport all updates to the stable channel. + version = "5.35.0"; # Please backport all updates to the stable channel. # All releases have a limited lifetime and "expire" 90 days after the release. # When releases "expire" the application becomes unusable until an update is # applied. The expiration date for the current release can be extracted with: @@ -34,7 +34,7 @@ in stdenv.mkDerivation rec { src = fetchurl { url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb"; - sha256 = "sha256-uU4WJtd9qwrjHgsK0oDg/pCf/5lfNhoMDEd/lHUnLwk="; + sha256 = "sha256-2KF2OLq6/vHElgloxn+kgQisJC+HAkpOBfsKfEPW35c="; }; nativeBuildInputs = [ From 71b07eaac3552d41c92a604059840e3c5589a657 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 13 Mar 2022 07:55:25 +0000 Subject: [PATCH 39/67] freedroidrpg: add upstream fix for -fno-common toolchains Without the upstream change build fails on toolchains that default to `-fno-common` (like clang-13 or upstream gcc-10+): $ nix build --impure --expr 'with import ./.{}; freedroidrpg.override { stdenv = clang13Stdenv; }' -L ... freedroidrpg> ld: addon_crafting_ui.o:/build/freedroidrpg-0.16.1/src/./struct.h:1025: multiple definition of `tux_rendering'; action.o:/build/freedroidrpg-0.16.1/src/./struct.h:1025: first defined here ... --- pkgs/games/freedroidrpg/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/games/freedroidrpg/default.nix b/pkgs/games/freedroidrpg/default.nix index e0582c524eca..84fd9c154a24 100644 --- a/pkgs/games/freedroidrpg/default.nix +++ b/pkgs/games/freedroidrpg/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, lib, stdenv, pkg-config, gettext, python3, SDL, SDL_image, SDL_gfx, SDL_mixer, libogg, libvorbis, lua5_3, libjpeg, libpng, zlib, libiconv }: +{ fetchurl, fetchpatch, lib, stdenv, pkg-config, gettext, python3, SDL, SDL_image, SDL_gfx, SDL_mixer, libogg, libvorbis, lua5_3, libjpeg, libpng, zlib, libiconv }: let version = "0.16.1"; @@ -11,6 +11,15 @@ in stdenv.mkDerivation { sha256 = "0n4kn38ncmcy3lrxmq8fjry6c1z50z4q1zcqfig0j4jb0dsz2va2"; }; + patches = [ + # Pull upstream fix for -fno-common tolchains. + (fetchpatch { + name = "fno-common.patch"; + url = "https://gitlab.com/freedroid/freedroid-src/-/commit/e610d427374226b79da5258d979936459f30c761.patch"; + sha256 = "1s7sw4dkc7b6i72j6x47driq6v0k3wss48l9ivd4fw40n3iaxjb1"; + }) + ]; + nativeBuildInputs = [ pkg-config gettext python3 ]; buildInputs = [ From 78e4513c3d03dc21ba47284a99cd92a94ec86348 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 13 Mar 2022 10:41:49 +0100 Subject: [PATCH 40/67] python3Packages.pudb: disable on older Python releeases --- pkgs/development/python-modules/pudb/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pudb/default.nix b/pkgs/development/python-modules/pudb/default.nix index 4e5839f7feed..45ab2e840a23 100644 --- a/pkgs/development/python-modules/pudb/default.nix +++ b/pkgs/development/python-modules/pudb/default.nix @@ -1,7 +1,7 @@ { lib , buildPythonPackage , dataclasses -, isPy3k +, pythonOlder , fetchPypi , jedi , pygments @@ -17,11 +17,11 @@ buildPythonPackage rec { version = "2022.1.1"; format = "setuptools"; - disabled = !isPy3k; + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "sha256-2zvdZkI8nSkHTBwsSfyyJL0Nbwgxn+0bTn6taDkUCD8="; + hash = "sha256-2zvdZkI8nSkHTBwsSfyyJL0Nbwgxn+0bTn6taDkUCD8="; }; propagatedBuildInputs = [ From bc72629eee81ce75520f835dbb09257ad3be65b9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 13 Mar 2022 10:45:53 +0100 Subject: [PATCH 41/67] python3Packages.pudb: remove duplicate input --- pkgs/development/python-modules/pudb/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/python-modules/pudb/default.nix b/pkgs/development/python-modules/pudb/default.nix index 45ab2e840a23..406d81e15bb0 100644 --- a/pkgs/development/python-modules/pudb/default.nix +++ b/pkgs/development/python-modules/pudb/default.nix @@ -1,7 +1,6 @@ { lib , buildPythonPackage , dataclasses -, pythonOlder , fetchPypi , jedi , pygments From d52b93750e524b4f5c4233094b767f7630e6e11f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 13 Mar 2022 09:54:56 +0000 Subject: [PATCH 42/67] gitleaks: 8.3.0 -> 8.4.0 --- pkgs/tools/security/gitleaks/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/gitleaks/default.nix b/pkgs/tools/security/gitleaks/default.nix index ff70782dabef..a574c3476290 100644 --- a/pkgs/tools/security/gitleaks/default.nix +++ b/pkgs/tools/security/gitleaks/default.nix @@ -5,16 +5,16 @@ buildGoModule rec { pname = "gitleaks"; - version = "8.3.0"; + version = "8.4.0"; src = fetchFromGitHub { owner = "zricethezav"; repo = pname; rev = "v${version}"; - sha256 = "sha256-D6leHpGZNQ9Xt4PSU0Dwte6N3bMge7itkZtcUl0mIrQ="; + sha256 = "sha256-z3YGRDgBGpr2hixIayih4wxGWPtYL0EPAuTYVPByzQc="; }; - vendorSha256 = "sha256-JZOalUOIeV51Nttm6xeBos+/8fleSBpUiXa8ekVuYJA="; + vendorSha256 = "sha256-J1xX+r+Mph1QkqjK87tqGDkYvPZp0lHgdRhd88WZi1c="; ldflags = [ "-s" From 90d9b7c8dc770611f744aa6fad2e1f32a167e807 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 13 Mar 2022 13:33:21 +0100 Subject: [PATCH 43/67] llvmPackages: Fix the update script --- pkgs/development/compilers/llvm/14/llvm/default.nix | 3 +++ pkgs/development/compilers/llvm/update.sh | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/14/llvm/default.nix b/pkgs/development/compilers/llvm/14/llvm/default.nix index d2059cc66ba2..05aac728b452 100644 --- a/pkgs/development/compilers/llvm/14/llvm/default.nix +++ b/pkgs/development/compilers/llvm/14/llvm/default.nix @@ -209,6 +209,9 @@ in stdenv.mkDerivation (rec { checkTarget = "check-all"; + # For the update script: + passthru.monorepoSrc = monorepoSrc; + requiredSystemFeatures = [ "big-parallel" ]; meta = llvm_meta // { homepage = "https://llvm.org/"; diff --git a/pkgs/development/compilers/llvm/update.sh b/pkgs/development/compilers/llvm/update.sh index 603c603f275b..95ad356dbd9a 100755 --- a/pkgs/development/compilers/llvm/update.sh +++ b/pkgs/development/compilers/llvm/update.sh @@ -20,7 +20,11 @@ sed -Ei \ readonly ATTRSET="llvmPackages_$VERSION_MAJOR" -if [ "$VERSION_MAJOR" -ge "13" ]; then +if [ "$VERSION_MAJOR" -ge "14" ]; then + readonly SOURCES=( + "llvm.monorepoSrc" + ) +elif [ "$VERSION_MAJOR" -eq "13" ]; then readonly SOURCES=( "llvm.src" ) @@ -43,7 +47,7 @@ fi for SOURCE in "${SOURCES[@]}"; do echo "Updating the hash of $SOURCE:" declare ATTR="$ATTRSET.$SOURCE" - declare OLD_HASH="$(nix eval -f . $ATTR.outputHash)" + declare OLD_HASH="$(nix --extra-experimental-features nix-command eval -f . $ATTR.outputHash)" declare NEW_HASH="\"$(nix-prefetch-url -A $ATTR)\"" find "$DIR" -type f -exec sed -i "s/$OLD_HASH/$NEW_HASH/" {} + done From f0c2e464685a4e638f088d4b18e57a32a7014239 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 13 Mar 2022 13:34:02 +0100 Subject: [PATCH 44/67] llvmPackages_14: 14.0.0-rc2 -> 14.0.0-rc4 --- pkgs/development/compilers/llvm/14/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/14/default.nix b/pkgs/development/compilers/llvm/14/default.nix index 5a91fb17fe61..ce126f7b502f 100644 --- a/pkgs/development/compilers/llvm/14/default.nix +++ b/pkgs/development/compilers/llvm/14/default.nix @@ -19,7 +19,7 @@ let release_version = "14.0.0"; - candidate = "rc2"; # empty or "rcN" + candidate = "rc4"; # empty or "rcN" dash-candidate = lib.optionalString (candidate != "") "-${candidate}"; rev = ""; # When using a Git commit rev-version = ""; # When using a Git commit @@ -30,7 +30,7 @@ let owner = "llvm"; repo = "llvm-project"; rev = if rev != "" then rev else "llvmorg-${version}"; - sha256 = "sha256-5wJEaWvwJohtjqlIsBkqQ5rE6rcWw07MaQnN1RxPb5w="; + sha256 = "0xm3hscg6xv48rjdi7sg9ky960af1qyg5k3jyavnaqimlaj9wxgp"; }; llvm_meta = { From 884b37844e88dfc45d31cd2661576e7e17338348 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Sun, 13 Mar 2022 13:39:31 +0100 Subject: [PATCH 45/67] nix-output-monitor: 1.1.1.0 -> 1.1.2.0 --- pkgs/tools/nix/nix-output-monitor/default.nix | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/nix/nix-output-monitor/default.nix b/pkgs/tools/nix/nix-output-monitor/default.nix index caa9abb9a1d6..0f78600a0506 100644 --- a/pkgs/tools/nix/nix-output-monitor/default.nix +++ b/pkgs/tools/nix/nix-output-monitor/default.nix @@ -6,6 +6,7 @@ async, attoparsec, base, + bytestring, cassava, containers, data-default, @@ -36,13 +37,14 @@ unix, vector, wcwidth, + word8, }: mkDerivation { pname = "nix-output-monitor"; - version = "1.1.1.0"; + version = "1.1.2.0"; src = fetchzip { - url = "https://github.com/maralorn/nix-output-monitor/archive/refs/tags/v1.1.1.0.tar.gz"; - sha256 = "1zw7x1snyycl1bp5w7jh8wwnynqvw3g4glr293bnzi5jyirj5wlg"; + url = "https://github.com/maralorn/nix-output-monitor/archive/refs/tags/v1.1.2.0.tar.gz"; + sha256 = "03qhy4xzika41pxlmvpz3psgy54va72ipn9v1lv33l6369ikrhl1"; }; isLibrary = true; isExecutable = true; @@ -51,6 +53,7 @@ mkDerivation { async attoparsec base + bytestring cassava containers data-default @@ -74,12 +77,14 @@ mkDerivation { unix vector wcwidth + word8 ]; executableHaskellDepends = [ ansi-terminal async attoparsec base + bytestring cassava containers data-default @@ -103,12 +108,14 @@ mkDerivation { unix vector wcwidth + word8 ]; testHaskellDepends = [ ansi-terminal async attoparsec base + bytestring cassava containers data-default @@ -134,6 +141,7 @@ mkDerivation { unix vector wcwidth + word8 ]; homepage = "https://github.com/maralorn/nix-output-monitor"; description = "Parses output of nix-build to show additional information"; @@ -148,11 +156,9 @@ mkDerivation { ${expect}/bin/unbuffer nix-build "\$@" 2>&1 | exec $out/bin/nom EOF chmod a+x $out/bin/nom-build - installShellCompletion --zsh --name _nom-build ${ - builtins.toFile "completion.zsh" '' - #compdef nom-build - compdef nom-build=nix-build - '' - } + installShellCompletion --zsh --name _nom-build ${builtins.toFile "completion.zsh" '' + #compdef nom-build + compdef nom-build=nix-build + ''} ''; } From 3f25903151bb8db613fe93a20dba79c63b0ddb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Wallez?= Date: Sun, 13 Mar 2022 13:59:51 +0100 Subject: [PATCH 46/67] nixos/nixpkgs/doc: fix typo in the signature of attrsets.zipAttrs --- doc/functions/library/attrsets.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index a30f4edf4c19..052bfa1f6ae3 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1474,7 +1474,7 @@ lib.attrsets.zipAttrsWith
<function>lib.attrsets.zipAttrs</function> - zipAttrsWith :: [ AttrSet ] -> AttrSet + zipAttrs :: [ AttrSet ] -> AttrSet From d12186a6017e7fddaa0e97db90c4924485aca92c Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Sat, 12 Mar 2022 00:56:44 +0100 Subject: [PATCH 47/67] nixos/tomcat: configure default group and fix broken default package reference Without this fix, evaluating a NixOS configuration with Tomcat enabled and the default settings results in the following evaluation error: Failed assertions: - users.users.tomcat.group is unset. This used to default to nogroup, but this is unsafe. For example you can create a group for this user with: users.users.tomcat.group = "tomcat"; users.groups.tomcat = {}; --- nixos/modules/services/web-servers/tomcat.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/web-servers/tomcat.nix b/nixos/modules/services/web-servers/tomcat.nix index f9446fe125a3..877097cf3781 100644 --- a/nixos/modules/services/web-servers/tomcat.nix +++ b/nixos/modules/services/web-servers/tomcat.nix @@ -23,8 +23,8 @@ in package = mkOption { type = types.package; - default = pkgs.tomcat85; - defaultText = literalExpression "pkgs.tomcat85"; + default = pkgs.tomcat9; + defaultText = literalExpression "pkgs.tomcat9"; example = lib.literalExpression "pkgs.tomcat9"; description = '' Which tomcat package to use. @@ -127,7 +127,7 @@ in webapps = mkOption { type = types.listOf types.path; default = [ tomcat.webapps ]; - defaultText = literalExpression "[ pkgs.tomcat85.webapps ]"; + defaultText = literalExpression "[ config.services.tomcat.package.webapps ]"; description = "List containing WAR files or directories with WAR files which are web applications to be deployed on Tomcat"; }; @@ -201,6 +201,7 @@ in { uid = config.ids.uids.tomcat; description = "Tomcat user"; home = "/homeless-shelter"; + group = "tomcat"; extraGroups = cfg.extraGroups; }; From f332895cd18bdc2f0020039068d95dd1d3bfa84e Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 13 Mar 2022 13:25:58 +0000 Subject: [PATCH 48/67] python310Packages.types-requests: 2.27.11 -> 2.27.12 --- pkgs/development/python-modules/types-requests/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/types-requests/default.nix b/pkgs/development/python-modules/types-requests/default.nix index 165c65f3a9ef..c62190ff5dab 100644 --- a/pkgs/development/python-modules/types-requests/default.nix +++ b/pkgs/development/python-modules/types-requests/default.nix @@ -6,12 +6,12 @@ buildPythonPackage rec { pname = "types-requests"; - version = "2.27.11"; + version = "2.27.12"; format = "setuptools"; src = fetchPypi { inherit pname version; - sha256 = "sha256-an7SSyF4CvSlteJMMQss2IX7YS31/ZVYTQPYfl8qGVo="; + sha256 = "sha256-/ROC+i4o6shI+u2wMyhAIE8G8MtRcAjjx7goLKU+VtI="; }; propagatedBuildInputs = [ From 99dacc15d301f9e3f6d4576e8b16a72ebd47bfbc Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 13 Mar 2022 13:30:53 +0000 Subject: [PATCH 49/67] python310Packages.types-urllib3: 1.26.10 -> 1.26.11 --- pkgs/development/python-modules/types-urllib3/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/types-urllib3/default.nix b/pkgs/development/python-modules/types-urllib3/default.nix index 7bffc7826a3c..235535ce9716 100644 --- a/pkgs/development/python-modules/types-urllib3/default.nix +++ b/pkgs/development/python-modules/types-urllib3/default.nix @@ -5,12 +5,12 @@ buildPythonPackage rec { pname = "types-urllib3"; - version = "1.26.10"; + version = "1.26.11"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-omiY9TDmw/Q/JbkH8riESGho/9Vqn6qUy/mz624WXWo="; + hash = "sha256-JNZORBFohR6wXx0CLeGK4xVY9WScjxEX44TC6F4xMVs="; }; # Module doesn't have tests From 86fafe5f5026651ae5139f4880f177b350c8ec83 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Sun, 13 Mar 2022 14:31:43 +0100 Subject: [PATCH 50/67] nixos/tomcat: add basic test case using the example app --- nixos/tests/all-tests.nix | 1 + nixos/tests/tomcat.nix | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 nixos/tests/tomcat.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 043d8a56d0c6..23116a6253d3 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -524,6 +524,7 @@ in tinc = handleTest ./tinc {}; tinydns = handleTest ./tinydns.nix {}; tinywl = handleTest ./tinywl.nix {}; + tomcat = handleTest ./tomcat.nix {}; tor = handleTest ./tor.nix {}; # traefik test relies on docker-containers traefik = handleTestOn ["x86_64-linux"] ./traefik.nix {}; diff --git a/nixos/tests/tomcat.nix b/nixos/tests/tomcat.nix new file mode 100644 index 000000000000..e383f224e3d1 --- /dev/null +++ b/nixos/tests/tomcat.nix @@ -0,0 +1,21 @@ +import ./make-test-python.nix ({ pkgs, ... }: + +{ + name = "tomcat"; + + machine = { pkgs, ... }: { + services.tomcat.enable = true; + }; + + testScript = '' + machine.wait_for_unit("tomcat.service") + machine.wait_for_open_port(8080) + machine.wait_for_file("/var/tomcat/webapps/examples"); + machine.succeed( + "curl --fail http://localhost:8080/examples/servlets/servlet/HelloWorldExample | grep 'Hello World!'" + ) + machine.succeed( + "curl --fail http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp | grep 'Hello, world!'" + ) + ''; +}) From 164c966f4b47dbcf661b511a8a5205dacfb48eec Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 13 Mar 2022 13:43:34 +0000 Subject: [PATCH 51/67] python310Packages.unidiff: 0.7.0 -> 0.7.3 --- pkgs/development/python-modules/unidiff/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/unidiff/default.nix b/pkgs/development/python-modules/unidiff/default.nix index 7dfd5c9d276a..4c776070ae6e 100644 --- a/pkgs/development/python-modules/unidiff/default.nix +++ b/pkgs/development/python-modules/unidiff/default.nix @@ -2,11 +2,11 @@ buildPythonPackage rec { pname = "unidiff"; - version = "0.7.0"; + version = "0.7.3"; src = fetchPypi { inherit pname version; - sha256 = "91bb13b4969514a400679d9ae5e29a6ffad85346087677f8b5e2e036af817447"; + sha256 = "sha256-1fLlOpoA2zIkqMNjSbU4Dg4i0a7GxpSxT7lIPuk8YgU="; }; pythonImportsCheck = [ "unidiff" ]; From a6aceda140cd6846fb9cf0338dcfeeb539c5dd31 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 13 Mar 2022 11:33:30 +0100 Subject: [PATCH 52/67] php.packages.phive: init at 0.15.0 --- .../php-packages/phive/default.nix | 31 +++++++++++++++++++ pkgs/top-level/php-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/php-packages/phive/default.nix diff --git a/pkgs/development/php-packages/phive/default.nix b/pkgs/development/php-packages/phive/default.nix new file mode 100644 index 000000000000..f564cb536922 --- /dev/null +++ b/pkgs/development/php-packages/phive/default.nix @@ -0,0 +1,31 @@ +{ mkDerivation, fetchurl, makeWrapper, lib, php }: + +mkDerivation rec { + pname = "phive"; + version = "0.15.0"; + + src = fetchurl { + url = "https://github.com/phar-io/phive/releases/download/${version}/phive-${version}.phar"; + sha256 = "sha256-crMr8d5nsVt7+zQ5xPeph/JXmTEn6jJFVtp3mOgylB4="; + }; + + dontUnpack = true; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + install -D $src $out/libexec/phive/phive.phar + makeWrapper ${php}/bin/php $out/bin/phive \ + --add-flags "$out/libexec/phive/phive.phar" + runHook postInstall + ''; + + meta = with lib; { + description = "The Phar Installation and Verification Environment (PHIVE)"; + homepage = "https://github.com/phar-io/phive"; + license = licenses.bsd3; + maintainers = with maintainers; teams.php.members; + }; +} diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 81628686a315..1da6e934c24b 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -144,6 +144,8 @@ lib.makeScope pkgs.newScope (self: with self; { phing = callPackage ../development/php-packages/phing { }; + phive = callPackage ../development/php-packages/phive { }; + php-cs-fixer = callPackage ../development/php-packages/php-cs-fixer { }; php-parallel-lint = callPackage ../development/php-packages/php-parallel-lint { }; From a45244eb8e952e0c3ae20cc30737a5faabaf410d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 13 Mar 2022 16:39:37 +0100 Subject: [PATCH 53/67] mediaelch: 2.8.14 -> 2.8.16 --- pkgs/applications/misc/mediaelch/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/mediaelch/default.nix b/pkgs/applications/misc/mediaelch/default.nix index 7cfe873a44e6..2381e89640af 100644 --- a/pkgs/applications/misc/mediaelch/default.nix +++ b/pkgs/applications/misc/mediaelch/default.nix @@ -18,13 +18,13 @@ mkDerivation rec { pname = "mediaelch"; - version = "2.8.14"; + version = "2.8.16"; src = fetchFromGitHub { owner = "Komet"; repo = "MediaElch"; rev = "v${version}"; - sha256 = "sha256-yHThX5Xs+8SijNKgmg+4Mawbwi3zHA/DJQoIBy0Wchs="; + sha256 = "sha256-83bHfIRVAC+3RkCYmV+TBjjQxaFMHfVyxt5Jq44dzeI="; fetchSubmodules = true; }; From 40195e1c4e85d6eb1fc4fc14e424e16e4a89de7e Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 13 Mar 2022 16:37:51 +0100 Subject: [PATCH 54/67] php.packages: Add missing hooks. --- pkgs/development/php-packages/box/default.nix | 2 ++ pkgs/development/php-packages/deployer/default.nix | 2 ++ pkgs/development/php-packages/phing/default.nix | 2 ++ pkgs/development/php-packages/php-cs-fixer/default.nix | 2 ++ pkgs/development/php-packages/php-parallel-lint/default.nix | 4 ++++ pkgs/development/php-packages/phpcbf/default.nix | 2 ++ pkgs/development/php-packages/phpcs/default.nix | 2 ++ pkgs/development/php-packages/phpmd/default.nix | 2 ++ pkgs/development/php-packages/phpstan/default.nix | 2 ++ pkgs/development/php-packages/psalm/default.nix | 2 ++ pkgs/development/php-packages/psysh/default.nix | 2 ++ 11 files changed, 24 insertions(+) diff --git a/pkgs/development/php-packages/box/default.nix b/pkgs/development/php-packages/box/default.nix index b19b275019df..bc0f4ac636c6 100644 --- a/pkgs/development/php-packages/box/default.nix +++ b/pkgs/development/php-packages/box/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/box/box.phar makeWrapper ${php}/bin/php $out/bin/box \ --add-flags "-d phar.readonly=0 $out/libexec/box/box.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/deployer/default.nix b/pkgs/development/php-packages/deployer/default.nix index 7679fb5ea51b..661a6310958c 100644 --- a/pkgs/development/php-packages/deployer/default.nix +++ b/pkgs/development/php-packages/deployer/default.nix @@ -14,6 +14,7 @@ mkDerivation rec { nativeBuildInputs = [ makeWrapper installShellFiles ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/deployer/deployer.phar makeWrapper ${php}/bin/php $out/bin/dep --add-flags "$out/libexec/deployer/deployer.phar" @@ -22,6 +23,7 @@ mkDerivation rec { installShellCompletion --cmd dep \ --bash <($out/bin/dep autocomplete --install) \ --zsh <($out/bin/dep autocomplete --install) + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/phing/default.nix b/pkgs/development/php-packages/phing/default.nix index a8835241d098..6c5af7d5d275 100644 --- a/pkgs/development/php-packages/phing/default.nix +++ b/pkgs/development/php-packages/phing/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/phing/phing.phar makeWrapper ${php}/bin/php $out/bin/phing \ --add-flags "$out/libexec/phing/phing.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/php-cs-fixer/default.nix b/pkgs/development/php-packages/php-cs-fixer/default.nix index 292d0b2ca08f..90bd1af00789 100644 --- a/pkgs/development/php-packages/php-cs-fixer/default.nix +++ b/pkgs/development/php-packages/php-cs-fixer/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/php-cs-fixer/php-cs-fixer.phar makeWrapper ${php}/bin/php $out/bin/php-cs-fixer \ --add-flags "$out/libexec/php-cs-fixer/php-cs-fixer.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/php-parallel-lint/default.nix b/pkgs/development/php-packages/php-parallel-lint/default.nix index 50fd23540ee5..d0335142490e 100644 --- a/pkgs/development/php-packages/php-parallel-lint/default.nix +++ b/pkgs/development/php-packages/php-parallel-lint/default.nix @@ -20,15 +20,19 @@ mkDerivation { ]; buildPhase = '' + runHook preBuild composer dump-autoload box build + runHook postBuild ''; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D parallel-lint.phar $out/libexec/php-parallel-lint/php-parallel-lint.phar makeWrapper ${php}/bin/php $out/bin/php-parallel-lint \ --add-flags "$out/libexec/php-parallel-lint/php-parallel-lint.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/phpcbf/default.nix b/pkgs/development/php-packages/phpcbf/default.nix index cef7c2986e8f..1cc6f46bd09d 100644 --- a/pkgs/development/php-packages/phpcbf/default.nix +++ b/pkgs/development/php-packages/phpcbf/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/phpcbf/phpcbf.phar makeWrapper ${php}/bin/php $out/bin/phpcbf \ --add-flags "$out/libexec/phpcbf/phpcbf.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/phpcs/default.nix b/pkgs/development/php-packages/phpcs/default.nix index baad111cec55..877f587717da 100644 --- a/pkgs/development/php-packages/phpcs/default.nix +++ b/pkgs/development/php-packages/phpcs/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/phpcs/phpcs.phar makeWrapper ${php}/bin/php $out/bin/phpcs \ --add-flags "$out/libexec/phpcs/phpcs.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/phpmd/default.nix b/pkgs/development/php-packages/phpmd/default.nix index 763fd857c357..228fd25ea553 100644 --- a/pkgs/development/php-packages/phpmd/default.nix +++ b/pkgs/development/php-packages/phpmd/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/phpmd/phpmd.phar makeWrapper ${php}/bin/php $out/bin/phpmd \ --add-flags "$out/libexec/phpmd/phpmd.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/phpstan/default.nix b/pkgs/development/php-packages/phpstan/default.nix index 41840f5ba9e8..bced843d9559 100644 --- a/pkgs/development/php-packages/phpstan/default.nix +++ b/pkgs/development/php-packages/phpstan/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/phpstan/phpstan.phar makeWrapper ${php}/bin/php $out/bin/phpstan \ --add-flags "$out/libexec/phpstan/phpstan.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/psalm/default.nix b/pkgs/development/php-packages/psalm/default.nix index a772ae441a5f..01f79c36397d 100644 --- a/pkgs/development/php-packages/psalm/default.nix +++ b/pkgs/development/php-packages/psalm/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin install -D $src $out/libexec/psalm/psalm.phar makeWrapper ${php}/bin/php $out/bin/psalm \ --add-flags "$out/libexec/psalm/psalm.phar" + runHook postInstall ''; meta = with lib; { diff --git a/pkgs/development/php-packages/psysh/default.nix b/pkgs/development/php-packages/psysh/default.nix index 5b7c02eefd82..f1105dea9113 100644 --- a/pkgs/development/php-packages/psysh/default.nix +++ b/pkgs/development/php-packages/psysh/default.nix @@ -16,10 +16,12 @@ mkDerivation { nativeBuildInputs = [ makeWrapper ]; installPhase = '' + runHook preInstall mkdir -p $out/bin tar -xzf $src -C $out/bin chmod +x $out/bin/psysh wrapProgram $out/bin/psysh --prefix PATH : "${lib.makeBinPath [ php ]}" + runHook postInstall ''; meta = with lib; { From cdf8fde65753dd453894cf3e31eebf8a077d22b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 13 Mar 2022 18:26:09 +0100 Subject: [PATCH 55/67] nix-eval-jobs: 0.0.3 -> 0.0.4 --- pkgs/tools/package-management/nix-eval-jobs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/package-management/nix-eval-jobs/default.nix b/pkgs/tools/package-management/nix-eval-jobs/default.nix index dfcf11045cb1..1023d23432c2 100644 --- a/pkgs/tools/package-management/nix-eval-jobs/default.nix +++ b/pkgs/tools/package-management/nix-eval-jobs/default.nix @@ -11,12 +11,12 @@ }: stdenv.mkDerivation rec { pname = "nix-eval-jobs"; - version = "0.0.3"; + version = "0.0.4"; src = fetchFromGitHub { owner = "nix-community"; repo = pname; rev = "v${version}"; - hash = "sha256:0flnqn1vkr55sipii82vwjfkhv4p835d01f6yhlpbalxwy2kr14r"; + hash = "sha256-SCwvFlBYUlxCucjMO4GHhEQWZFZt0lRKJncm6hvDx9I="; }; buildInputs = [ boost From 540de8542d60c31aad9198a95d0e799474fe927a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 13 Mar 2022 18:33:12 +0000 Subject: [PATCH 56/67] python310Packages.aio-geojson-client: 0.16 -> 0.17 --- .../development/python-modules/aio-geojson-client/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aio-geojson-client/default.nix b/pkgs/development/python-modules/aio-geojson-client/default.nix index f00a75961b9c..b0629483d014 100644 --- a/pkgs/development/python-modules/aio-geojson-client/default.nix +++ b/pkgs/development/python-modules/aio-geojson-client/default.nix @@ -13,7 +13,7 @@ buildPythonPackage rec { pname = "aio-geojson-client"; - version = "0.16"; + version = "0.17"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -22,7 +22,7 @@ buildPythonPackage rec { owner = "exxamalte"; repo = "python-aio-geojson-client"; rev = "v${version}"; - hash = "sha256-u3SwrSxeBJrBTHfqKY/mAb2p1jqW2AvRsHomKsI81gM="; + hash = "sha256-5GiQgtbvYeleovFbXO2vlr2XPsDIWZiElM64O+urMcY="; }; propagatedBuildInputs = [ From 953de2094635feba95fc2a64d5b4bf10d8b0f1f6 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sun, 13 Mar 2022 13:29:15 -0300 Subject: [PATCH 57/67] pkgs/build-support/fetchurl/mirrors.nix: reoder --- pkgs/build-support/fetchurl/mirrors.nix | 513 ++++++++++++------------ 1 file changed, 264 insertions(+), 249 deletions(-) diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix index e4d6f02a94bd..fc7bce0ce56a 100644 --- a/pkgs/build-support/fetchurl/mirrors.nix +++ b/pkgs/build-support/fetchurl/mirrors.nix @@ -1,6 +1,6 @@ { - # Content-addressable Nix mirrors. + # Content-addressable Nix mirrors hashedMirrors = [ "https://tarballs.nixos.org" ]; @@ -8,52 +8,48 @@ # Mirrors for mirror://site/filename URIs, where "site" is # "sourceforge", "gnu", etc. - luarocks = [ - "https://luarocks.org/" - "https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/" - "https://luafr.org/moonrocks/" - "http://luarocks.logiceditor.com/rocks/" + # Alsa Project + alsa = [ + "https://www.alsa-project.org/files/pub/" + "ftp://ftp.alsa-project.org/pub/" + "http://alsa.cybermirror.org/" + "http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/" ]; - # SourceForge. - sourceforge = [ - "https://downloads.sourceforge.net/" - "https://prdownloads.sourceforge.net/" - "https://netcologne.dl.sourceforge.net/sourceforge/" - "https://versaweb.dl.sourceforge.net/sourceforge/" - "https://freefr.dl.sourceforge.net/sourceforge/" - "https://osdn.dl.sourceforge.net/sourceforge/" - "https://kent.dl.sourceforge.net/sourceforge/" + # Apache + apache = [ + "https://www-eu.apache.org/dist/" + "https://ftp.wayne.edu/apache/" + "https://www.apache.org/dist/" + "https://archive.apache.org/dist/" # fallback for old releases + "https://apache.cs.uu.nl/" + "https://apache.cs.utah.edu/" + "http://ftp.tudelft.nl/apache/" + "ftp://ftp.funet.fi/pub/mirrors/apache.org/" ]; - # OSDN (formerly SourceForge.jp). - osdn = [ - "https://osdn.dl.osdn.jp/" - "https://osdn.mirror.constant.com/" - "https://mirrors.gigenet.com/OSDN/" - "https://osdn.dl.sourceforge.jp/" - "https://jaist.dl.sourceforge.jp/" + # Bioconductor mirrors (from https://bioconductor.org/about/mirrors/) + # The commented-out ones don't seem to allow direct package downloads; + # they serve error messages that result in hash mismatches instead + bioc = [ + # http://bioc.ism.ac.jp/ + # http://bioc.openanalytics.eu/ + # http://bioconductor.fmrp.usp.br/ + # http://mirror.aarnet.edu.au/pub/bioconductor/ + # http://watson.nci.nih.gov/bioc_mirror/ + "https://bioconductor.statistik.tu-dortmund.de/packages/" + "https://mirrors.ustc.edu.cn/bioc/" + "http://bioconductor.jp/packages/" ]; - # GNU (https://www.gnu.org/prep/ftp.html). - gnu = [ - # This one redirects to a (supposedly) nearby and (supposedly) up-to-date - # mirror. - "https://ftpmirror.gnu.org/" - - "https://ftp.nluug.nl/pub/gnu/" - "https://mirrors.kernel.org/gnu/" - "https://mirror.ibcp.fr/pub/gnu/" - "https://mirror.dogado.de/gnu/" - "https://mirror.tochlab.net/pub/gnu/" - - # This one is the master repository, and thus it's always up-to-date. - "https://ftp.gnu.org/pub/gnu/" - - "ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/" + # BitlBee mirrors, see https://www.bitlbee.org/main.php/mirrors.html + bitlbee = [ + "https://get.bitlbee.org/" + "https://ftp.snt.utwente.nl/pub/software/bitlbee/" + "http://bitlbee.intergenia.de/" ]; - # GCC. + # GCC gcc = [ "https://bigsearcher.com/mirrors/gcc/" "https://mirror.koddos.net/gcc/" @@ -63,7 +59,37 @@ "ftp://gcc.gnu.org/pub/gcc/" ]; - # GnuPG. + # GNOME + gnome = [ + # This one redirects to some mirror closeby, so it should be all you need + "https://download.gnome.org/" + + "https://fr2.rpmfind.net/linux/gnome.org/" + "https://ftp.acc.umu.se/pub/GNOME/" + "https://ftp.belnet.be/mirror/ftp.gnome.org/" + "ftp://ftp.cse.buffalo.edu/pub/Gnome/" + "ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/" + ]; + + # GNU (https://www.gnu.org/prep/ftp.html) + gnu = [ + # This one redirects to a (supposedly) nearby and (supposedly) up-to-date + # mirror + "https://ftpmirror.gnu.org/" + + "https://ftp.nluug.nl/pub/gnu/" + "https://mirrors.kernel.org/gnu/" + "https://mirror.ibcp.fr/pub/gnu/" + "https://mirror.dogado.de/gnu/" + "https://mirror.tochlab.net/pub/gnu/" + + # This one is the master repository, and thus it's always up-to-date + "https://ftp.gnu.org/pub/gnu/" + + "ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/" + ]; + + # GnuPG gnupg = [ "https://gnupg.org/ftp/gcrypt/" "https://mirrors.dotsrc.org/gcrypt/" @@ -72,11 +98,13 @@ "http://www.ring.gr.jp/pub/net/" ]; - # kernel.org's /pub (/pub/{linux,software}) tree. - kernel = [ - "https://cdn.kernel.org/pub/" - "http://linux-kernel.uio.no/pub/" - "ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/" + # ImageMagick mirrors, see https://www.imagemagick.org/script/mirror.php + imagemagick = [ + "https://www.imagemagick.org/download/" + "https://mirror.checkdomain.de/imagemagick/" + "https://ftp.nluug.nl/ImageMagick/" + "https://ftp.sunet.se/mirror/imagemagick.org/ftp/" + "ftp://ftp.sunet.se/mirror/imagemagick.org/ftp/" # also contains older versions removed from most mirrors ]; # Mirrors from https://download.kde.org/ls-lR.mirrorlist @@ -89,195 +117,47 @@ "https://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/" ]; - # Gentoo files. - gentoo = [ - "https://ftp.snt.utwente.nl/pub/os/linux/gentoo/" - "https://distfiles.gentoo.org/" - "https://mirrors.kernel.org/gentoo/" - ]; - - savannah = [ - # Mirrors from https://download-mirror.savannah.gnu.org/releases/00_MIRRORS.html - "https://mirror.easyname.at/nongnu/" - "https://savannah.c3sl.ufpr.br/" - "https://mirror.csclub.uwaterloo.ca/nongnu/" - "https://mirror.cedia.org.ec/nongnu/" - "https://ftp.igh.cnrs.fr/pub/nongnu/" - "https://mirror6.layerjet.com/nongnu" - "https://mirror.netcologne.de/savannah/" - "https://ftp.cc.uoc.gr/mirrors/nongnu.org/" - "https://nongnu.uib.no/" - "https://ftp.acc.umu.se/mirror/gnu.org/savannah/" - "http://mirror2.klaus-uwe.me/nongnu/" - "http://mirrors.fe.up.pt/pub/nongnu/" - "http://ftp.twaren.net/Unix/NonGNU/" - "http://savannah-nongnu-org.ip-connect.vn.ua/" - "http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/" - "http://gnu.mirrors.pair.com/savannah/savannah/" - "ftp://mirror.easyname.at/nongnu/" - "ftp://mirror2.klaus-uwe.me/nongnu/" - "ftp://mirror.csclub.uwaterloo.ca/nongnu/" - "ftp://ftp.igh.cnrs.fr/pub/nongnu/" - "ftp://mirror.netcologne.de/savannah/" - "ftp://nongnu.uib.no/pub/nongnu/" - "ftp://mirrors.fe.up.pt/pub/nongnu/" - "ftp://ftp.twaren.net/Unix/NonGNU/" - "ftp://savannah-nongnu-org.ip-connect.vn.ua/mirror/savannah.nongnu.org/" - "ftp://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/" - ]; - - samba = [ - "https://www.samba.org/ftp/" - "http://www.samba.org/ftp/" - ]; - - # BitlBee mirrors, see https://www.bitlbee.org/main.php/mirrors.html . - bitlbee = [ - "https://get.bitlbee.org/" - "https://ftp.snt.utwente.nl/pub/software/bitlbee/" - "http://bitlbee.intergenia.de/" - ]; - - # ImageMagick mirrors, see https://www.imagemagick.org/script/mirror.php - imagemagick = [ - "https://www.imagemagick.org/download/" - "https://mirror.checkdomain.de/imagemagick/" - "https://ftp.nluug.nl/ImageMagick/" - "https://ftp.sunet.se/mirror/imagemagick.org/ftp/" - "ftp://ftp.sunet.se/mirror/imagemagick.org/ftp/" # also contains older versions removed from most mirrors - ]; - - # CPAN mirrors. - cpan = [ - "https://cpan.metacpan.org/" - "https://cpan.perl.org/" - "https://mirrors.kernel.org/CPAN/" - "https://backpan.perl.org/" # for old releases - ]; - - # CentOS. - centos = [ - # For old releases - "https://vault.centos.org/" - "https://archive.kernel.org/centos-vault/" - "https://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/" - "https://mirrors.aliyun.com/centos-vault/" - "https://mirror.chpc.utah.edu/pub/vault.centos.org/" - "https://mirror.math.princeton.edu/pub/centos-vault/" - "https://mirrors.tripadvisor.com/centos-vault/" - "http://mirror.centos.org/centos/" - ]; - - # Debian. - debian = [ - "https://httpredir.debian.org/debian/" - "https://ftp.debian.org/debian/" - "https://mirrors.edge.kernel.org/debian/" - "ftp://ftp.de.debian.org/debian/" - "ftp://ftp.fr.debian.org/debian/" - "ftp://ftp.nl.debian.org/debian/" - "ftp://ftp.ru.debian.org/debian/" - "http://archive.debian.org/debian-archive/debian/" - "ftp://ftp.funet.fi/pub/mirrors/ftp.debian.org/debian/" - ]; - - # Ubuntu. - ubuntu = [ - "https://nl.archive.ubuntu.com/ubuntu/" - "https://old-releases.ubuntu.com/ubuntu/" - "https://mirrors.edge.kernel.org/ubuntu/" - "http://de.archive.ubuntu.com/ubuntu/" - "http://archive.ubuntu.com/ubuntu/" - ]; - - # Fedora (please only add full mirrors that carry old Fedora distributions as well). - # See: https://mirrors.fedoraproject.org/publiclist (but not all carry old content). - fedora = [ - "https://archives.fedoraproject.org/pub/fedora/" - "https://fedora.osuosl.org/" - "https://ftp.funet.fi/pub/mirrors/ftp.redhat.com/pub/fedora/" - "https://ftp.linux.cz/pub/linux/fedora/" - "https://archives.fedoraproject.org/pub/archive/fedora/" - "http://ftp.nluug.nl/pub/os/Linux/distr/fedora/" - "http://mirror.csclub.uwaterloo.ca/fedora/" - "http://mirror.1000mbps.com/fedora/" - ]; - - # openSUSE. - opensuse = [ - "https://opensuse.hro.nl/opensuse/distribution/" - "https://ftp.funet.fi/pub/linux/mirrors/opensuse/distribution/" - "https://ftp.opensuse.org/pub/opensuse/distribution/" - "https://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/" - "https://mirrors.edge.kernel.org/opensuse/distribution/" - "http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/" - ]; - - gnome = [ - # This one redirects to some mirror closeby, so it should be all you need. - "https://download.gnome.org/" - - "https://fr2.rpmfind.net/linux/gnome.org/" - "https://ftp.acc.umu.se/pub/GNOME/" - "https://ftp.belnet.be/mirror/ftp.gnome.org/" - "ftp://ftp.cse.buffalo.edu/pub/Gnome/" - "ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/" - ]; - - xfce = [ - "https://archive.xfce.org/" - "https://mirror.netcologne.de/xfce/" - "https://archive.be.xfce.org/xfce/" - "https://archive.al-us.xfce.org/" - "http://archive.se.xfce.org/xfce/" - "http://mirror.perldude.de/archive.xfce.org/" - "http://archive.be2.xfce.org/" - "http://ftp.udc.es/xfce/" - ]; - - # X.org. - xorg = [ - "https://xorg.freedesktop.org/releases/" - "https://ftp.x.org/archive/" - ]; - - apache = [ - "https://www-eu.apache.org/dist/" - "https://ftp.wayne.edu/apache/" - "https://www.apache.org/dist/" - "https://archive.apache.org/dist/" # fallback for old releases - "https://apache.cs.uu.nl/" - "https://apache.cs.utah.edu/" - "http://ftp.tudelft.nl/apache/" - "ftp://ftp.funet.fi/pub/mirrors/apache.org/" - ]; - - postgresql = [ - "https://ftp.postgresql.org/pub/" + # kernel.org's /pub (/pub/{linux,software}) tree + kernel = [ + "https://cdn.kernel.org/pub/" + "http://linux-kernel.uio.no/pub/" + "ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/" ]; + # Metalab, now IBiblio metalab = [ "ftp://ftp.gwdg.de/pub/linux/metalab/" "ftp://ftp.metalab.unc.edu/pub/linux/" ]; - # Bioconductor mirrors (from https://bioconductor.org/about/mirrors/) - # The commented-out ones don't seem to allow direct package downloads; - # they serve error messages that result in hash mismatches instead. - bioc = [ - # http://bioc.ism.ac.jp/ - # http://bioc.openanalytics.eu/ - # http://bioconductor.fmrp.usp.br/ - # http://mirror.aarnet.edu.au/pub/bioconductor/ - # http://watson.nci.nih.gov/bioc_mirror/ - "https://bioconductor.statistik.tu-dortmund.de/packages/" - "https://mirrors.ustc.edu.cn/bioc/" - "http://bioconductor.jp/packages/" + # MySQL + mysql = [ + "https://cdn.mysql.com/Downloads/" ]; - # Hackage mirrors - hackage = [ - "https://hackage.haskell.org/package/" + # Maven Central + maven = [ + "https://repo1.maven.org/maven2/" + ]; + + # Mozilla projects + mozilla = [ + "https://download.cdn.mozilla.net/pub/mozilla.org/" + "https://archive.mozilla.org/pub/" + ]; + + # OSDN (formerly SourceForge.jp) + osdn = [ + "https://osdn.dl.osdn.jp/" + "https://osdn.mirror.constant.com/" + "https://mirrors.gigenet.com/OSDN/" + "https://osdn.dl.sourceforge.jp/" + "https://jaist.dl.sourceforge.jp/" + ]; + + # PostgreSQL + postgresql = [ + "https://ftp.postgresql.org/pub/" ]; # Roy marples mirrors @@ -329,25 +209,102 @@ "http://ftp.ntua.gr/pub/sagemath/spkg/upstream/" ]; - # MySQL mirrors - mysql = [ - "https://cdn.mysql.com/Downloads/" + # SAMBA + samba = [ + "https://www.samba.org/ftp/" + "http://www.samba.org/ftp/" ]; - # OpenBSD mirrors - openbsd = [ - "https://ftp.openbsd.org/pub/OpenBSD/" - "ftp://ftp.nluug.nl/pub/OpenBSD/" - "ftp://ftp-stud.fht-esslingen.de/pub/OpenBSD/" + # GNU Savannah + savannah = [ + # Mirrors from https://download-mirror.savannah.gnu.org/releases/00_MIRRORS.html + "https://mirror.easyname.at/nongnu/" + "https://savannah.c3sl.ufpr.br/" + "https://mirror.csclub.uwaterloo.ca/nongnu/" + "https://mirror.cedia.org.ec/nongnu/" + "https://ftp.igh.cnrs.fr/pub/nongnu/" + "https://mirror6.layerjet.com/nongnu" + "https://mirror.netcologne.de/savannah/" + "https://ftp.cc.uoc.gr/mirrors/nongnu.org/" + "https://nongnu.uib.no/" + "https://ftp.acc.umu.se/mirror/gnu.org/savannah/" + "http://mirror2.klaus-uwe.me/nongnu/" + "http://mirrors.fe.up.pt/pub/nongnu/" + "http://ftp.twaren.net/Unix/NonGNU/" + "http://savannah-nongnu-org.ip-connect.vn.ua/" + "http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/" + "http://gnu.mirrors.pair.com/savannah/savannah/" + "ftp://mirror.easyname.at/nongnu/" + "ftp://mirror2.klaus-uwe.me/nongnu/" + "ftp://mirror.csclub.uwaterloo.ca/nongnu/" + "ftp://ftp.igh.cnrs.fr/pub/nongnu/" + "ftp://mirror.netcologne.de/savannah/" + "ftp://nongnu.uib.no/pub/nongnu/" + "ftp://mirrors.fe.up.pt/pub/nongnu/" + "ftp://ftp.twaren.net/Unix/NonGNU/" + "ftp://savannah-nongnu-org.ip-connect.vn.ua/mirror/savannah.nongnu.org/" + "ftp://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/" ]; - # Steam Runtime mirrors + # SourceForge + sourceforge = [ + "https://downloads.sourceforge.net/" + "https://prdownloads.sourceforge.net/" + "https://netcologne.dl.sourceforge.net/sourceforge/" + "https://versaweb.dl.sourceforge.net/sourceforge/" + "https://freefr.dl.sourceforge.net/sourceforge/" + "https://osdn.dl.sourceforge.net/sourceforge/" + "https://kent.dl.sourceforge.net/sourceforge/" + ]; + + # Steam Runtime steamrt = [ "https://repo.steampowered.com/steamrt/" "https://public.abbradar.moe/steamrt/" ]; - # Python PyPI mirrors + # XFCE + xfce = [ + "https://archive.xfce.org/" + "https://mirror.netcologne.de/xfce/" + "https://archive.be.xfce.org/xfce/" + "https://archive.al-us.xfce.org/" + "http://archive.se.xfce.org/xfce/" + "http://mirror.perldude.de/archive.xfce.org/" + "http://archive.be2.xfce.org/" + "http://ftp.udc.es/xfce/" + ]; + + # X.org + xorg = [ + "https://xorg.freedesktop.org/releases/" + "https://ftp.x.org/archive/" + ]; + + ### Programming languages' package repos + + # Perl CPAN + cpan = [ + "https://cpan.metacpan.org/" + "https://cpan.perl.org/" + "https://mirrors.kernel.org/CPAN/" + "https://backpan.perl.org/" # for old releases + ]; + + # Haskell Hackage + hackage = [ + "https://hackage.haskell.org/package/" + ]; + + # Lua Rocks + luarocks = [ + "https://luarocks.org/" + "https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/" + "https://luafr.org/moonrocks/" + "http://luarocks.logiceditor.com/rocks/" + ]; + + # Python PyPI pypi = [ "https://files.pythonhosted.org/packages/source/" # pypi.io is a more semantic link, but atm it’s referencing @@ -355,27 +312,85 @@ "https://pypi.io/packages/source/" ]; - # Python Test-PyPI mirror + # Python Test-PyPI testpypi = [ "https://test.pypi.io/packages/source/" ]; - # Mozilla projects. - mozilla = [ - "https://download.cdn.mozilla.net/pub/mozilla.org/" - "https://archive.mozilla.org/pub/" + ### Linux distros + + # CentOS + centos = [ + # For old releases + "https://vault.centos.org/" + "https://archive.kernel.org/centos-vault/" + "https://ftp.jaist.ac.jp/pub/Linux/CentOS-vault/" + "https://mirrors.aliyun.com/centos-vault/" + "https://mirror.chpc.utah.edu/pub/vault.centos.org/" + "https://mirror.math.princeton.edu/pub/centos-vault/" + "https://mirrors.tripadvisor.com/centos-vault/" + "http://mirror.centos.org/centos/" ]; - # Maven Central - maven = [ - "https://repo1.maven.org/maven2/" + # Debian + debian = [ + "https://httpredir.debian.org/debian/" + "https://ftp.debian.org/debian/" + "https://mirrors.edge.kernel.org/debian/" + "ftp://ftp.de.debian.org/debian/" + "ftp://ftp.fr.debian.org/debian/" + "ftp://ftp.nl.debian.org/debian/" + "ftp://ftp.ru.debian.org/debian/" + "http://archive.debian.org/debian-archive/debian/" + "ftp://ftp.funet.fi/pub/mirrors/ftp.debian.org/debian/" ]; - # Alsa Project - alsa = [ - "https://www.alsa-project.org/files/pub/" - "ftp://ftp.alsa-project.org/pub/" - "http://alsa.cybermirror.org/" - "http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/" + # Fedora + # Please add only full mirrors that carry old Fedora distributions as well + # See: https://mirrors.fedoraproject.org/publiclist (but not all carry old content) + fedora = [ + "https://archives.fedoraproject.org/pub/fedora/" + "https://fedora.osuosl.org/" + "https://ftp.funet.fi/pub/mirrors/ftp.redhat.com/pub/fedora/" + "https://ftp.linux.cz/pub/linux/fedora/" + "https://archives.fedoraproject.org/pub/archive/fedora/" + "http://ftp.nluug.nl/pub/os/Linux/distr/fedora/" + "http://mirror.csclub.uwaterloo.ca/fedora/" + "http://mirror.1000mbps.com/fedora/" + ]; + + # Gentoo + gentoo = [ + "https://ftp.snt.utwente.nl/pub/os/linux/gentoo/" + "https://distfiles.gentoo.org/" + "https://mirrors.kernel.org/gentoo/" + ]; + + # openSUSE + opensuse = [ + "https://opensuse.hro.nl/opensuse/distribution/" + "https://ftp.funet.fi/pub/linux/mirrors/opensuse/distribution/" + "https://ftp.opensuse.org/pub/opensuse/distribution/" + "https://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/" + "https://mirrors.edge.kernel.org/opensuse/distribution/" + "http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/" + ]; + + # Ubuntu + ubuntu = [ + "https://nl.archive.ubuntu.com/ubuntu/" + "https://old-releases.ubuntu.com/ubuntu/" + "https://mirrors.edge.kernel.org/ubuntu/" + "http://de.archive.ubuntu.com/ubuntu/" + "http://archive.ubuntu.com/ubuntu/" + ]; + + # ... and other OSes in general + + # OpenBSD + openbsd = [ + "https://ftp.openbsd.org/pub/OpenBSD/" + "ftp://ftp.nluug.nl/pub/OpenBSD/" + "ftp://ftp-stud.fht-esslingen.de/pub/OpenBSD/" ]; } From 2d88a59de11f1c16fbb31829307b6c3e560839da Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sun, 13 Mar 2022 15:39:09 -0300 Subject: [PATCH 58/67] pkgs/build-support/fetchurl/mirrors.nix: add TCSH mirrors --- pkgs/build-support/fetchurl/mirrors.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix index fc7bce0ce56a..82f768daa5fa 100644 --- a/pkgs/build-support/fetchurl/mirrors.nix +++ b/pkgs/build-support/fetchurl/mirrors.nix @@ -263,6 +263,18 @@ "https://public.abbradar.moe/steamrt/" ]; + # TCSH shell + tcsh = [ + "https://astron.com/pub/tcsh/" + "https://astron.com/pub/tcsh/old/" + "http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/" + "http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/old/" + "ftp://ftp.astron.com/pub/tcsh/" + "ftp://ftp.astron.com/pub/tcsh/old/" + "ftp://ftp.funet.fi/pub/unix/shells/tcsh/" + "ftp://ftp.funet.fi/pub/unix/shells/tcsh/old/" + ]; + # XFCE xfce = [ "https://archive.xfce.org/" From 7b212f90e72fa665171ac591eb1cf2a7ef6166fa Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sun, 13 Mar 2022 14:12:59 -0300 Subject: [PATCH 59/67] tcsh: use tcsh mirrors --- pkgs/shells/tcsh/default.nix | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/pkgs/shells/tcsh/default.nix b/pkgs/shells/tcsh/default.nix index 2c8548fb1fd1..4357ca605b17 100644 --- a/pkgs/shells/tcsh/default.nix +++ b/pkgs/shells/tcsh/default.nix @@ -10,17 +10,7 @@ stdenv.mkDerivation rec { version = "6.24.00"; src = fetchurl { - urls = [ - "https://astron.com/pub/tcsh/${pname}-${version}.tar.gz" - "https://astron.com/pub/tcsh/old/${pname}-${version}.tar.gz" - "http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/${pname}-${version}.tar.gz" - "http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/old/${pname}-${version}.tar.gz" - - "ftp://ftp.astron.com/pub/tcsh/${pname}-${version}.tar.gz" - "ftp://ftp.astron.com/pub/tcsh/old/${pname}-${version}.tar.gz" - "ftp://ftp.funet.fi/pub/unix/shells/tcsh/${pname}-${version}.tar.gz" - "ftp://ftp.funet.fi/pub/unix/shells/tcsh/old/${pname}-${version}.tar.gz" - ]; + url = "mirror://tcsh/${pname}-${version}.tar.gz"; hash = "sha256-YL4sUEvY8fpuQksZVkldfnztUqKslNtf0n9La/yPdPA="; }; @@ -29,6 +19,7 @@ stdenv.mkDerivation rec { ]; patches = lib.optional stdenv.hostPlatform.isMusl + # Use system malloc (fetchpatch { name = "sysmalloc.patch"; url = "https://git.alpinelinux.org/aports/plain/community/tcsh/001-sysmalloc.patch?id=184585c046cdd56512f1a76e426dd799b368f8cf"; From 201d1632e71707929b3341b0a52e53acfcc454d9 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 13 Mar 2022 15:04:39 +0100 Subject: [PATCH 60/67] =?UTF-8?q?ocamlPackages.spacetime=5Flib:=20disable?= =?UTF-8?q?=20for=20OCaml=20=E2=89=A5=204.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/spacetime_lib/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/ocaml-modules/spacetime_lib/default.nix b/pkgs/development/ocaml-modules/spacetime_lib/default.nix index 009b2ce32619..442d06e4f698 100644 --- a/pkgs/development/ocaml-modules/spacetime_lib/default.nix +++ b/pkgs/development/ocaml-modules/spacetime_lib/default.nix @@ -1,4 +1,7 @@ -{ lib, fetchFromGitHub, buildDunePackage, owee }: +{ lib, fetchFromGitHub, buildDunePackage, ocaml, owee }: + +lib.throwIfNot (lib.versionAtLeast "4.12" ocaml.version) + "spacetime_lib is not available for OCaml ${ocaml.version}" buildDunePackage rec { pname = "spacetime_lib"; From 804d792c44c4b7bef74cb79146c8f220b5d17959 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 13 Mar 2022 15:04:53 +0100 Subject: [PATCH 61/67] =?UTF-8?q?ocamlPackages.owee:=200.3=20=E2=86=92=200?= =?UTF-8?q?.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/owee/default.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/development/ocaml-modules/owee/default.nix b/pkgs/development/ocaml-modules/owee/default.nix index 9eb81003d47a..7b15437a7ed2 100644 --- a/pkgs/development/ocaml-modules/owee/default.nix +++ b/pkgs/development/ocaml-modules/owee/default.nix @@ -1,20 +1,19 @@ -{ lib, buildDunePackage, fetchFromGitHub }: +{ lib, buildDunePackage, fetchurl }: buildDunePackage rec { - minimumOCamlVersion = "4.06"; + minimalOCamlVersion = "4.06"; + useDune2 = true; pname = "owee"; - version = "0.3"; + version = "0.4"; - src = fetchFromGitHub { - owner = "let-def"; - repo = "owee"; - rev = "v${version}"; - sha256 = "0jp8ca57488d7sj2nqy4yxcdpda6sxx51yyi8k6888hbinhyqp0j"; + src = fetchurl { + url = "https://github.com/let-def/owee/releases/download/v${version}/owee-${version}.tbz"; + sha256 = "sha256:055bi0yfdki1pqagbhrwmfvigyawjgsmqw04zhpp6hds8513qzvb"; }; meta = { description = "An experimental OCaml library to work with DWARF format"; - inherit (src.meta) homepage; + homepage = "https://github.com/let-def/owee/"; license = lib.licenses.mit; maintainers = [ lib.maintainers.vbgl ]; }; From 4d10c11d98b14070bac36c6cd1360a2f16083c0d Mon Sep 17 00:00:00 2001 From: Ulrik Strid Date: Fri, 4 Mar 2022 11:33:22 +0100 Subject: [PATCH 62/67] ocamlPackages.ocamlfuse: 2.7.1_cvs6 -> 2.7.1_cvs7 Co-authored-by: Sandro --- pkgs/development/ocaml-modules/ocamlfuse/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/ocaml-modules/ocamlfuse/default.nix b/pkgs/development/ocaml-modules/ocamlfuse/default.nix index 4dcaca427886..13ac62f64514 100644 --- a/pkgs/development/ocaml-modules/ocamlfuse/default.nix +++ b/pkgs/development/ocaml-modules/ocamlfuse/default.nix @@ -1,14 +1,14 @@ { lib, buildDunePackage, fetchFromGitHub, camlidl, fuse, dune-configurator }: -buildDunePackage { +buildDunePackage rec { pname = "ocamlfuse"; - version = "2.7.1_cvs6_e35e76b"; + version = "2.7.1_cvs7"; src = fetchFromGitHub { owner = "astrada"; repo = "ocamlfuse"; - rev = "e35e76bee3b06806256b5bfca108b7697267cd5c"; - sha256 = "1v9g0wh7rnjkrjrnw50145g6ry38plyjs8fq8w0nlzwizhf3qhff"; + rev = "v${version}"; + sha256 = "6nmPXZx38hBGlg+gV9nnlRpPfeSAqDj4zBPcjUNvTRo="; }; # This currently fails with dune From b5359c444e881e36864c658bbcfc61259544c023 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 13 Mar 2022 15:39:14 +0100 Subject: [PATCH 63/67] buildDunePackage: use dune_2 by default --- doc/languages-frameworks/ocaml.section.md | 4 ++-- pkgs/build-support/ocaml/dune.nix | 2 +- pkgs/development/ocaml-modules/facile/default.nix | 2 ++ pkgs/development/ocaml-modules/genspio/default.nix | 4 +++- pkgs/development/ocaml-modules/janestreet/janePackage.nix | 4 +++- .../development/ocaml-modules/janestreet/janePackage_0_12.nix | 2 ++ pkgs/development/ocaml-modules/lwt/camlp4.nix | 4 +++- pkgs/development/ocaml-modules/nonstd/default.nix | 4 +++- pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix | 2 ++ 9 files changed, 21 insertions(+), 7 deletions(-) diff --git a/doc/languages-frameworks/ocaml.section.md b/doc/languages-frameworks/ocaml.section.md index 47035551d418..e4813d7dd2d4 100644 --- a/doc/languages-frameworks/ocaml.section.md +++ b/doc/languages-frameworks/ocaml.section.md @@ -38,8 +38,8 @@ Here is a simple package example. - It uses the `fetchFromGitHub` fetcher to get its source. -- `useDune2 = true` ensures that the latest version of Dune is used for the - build (this may become the default value in a future release). +- `useDune2 = true` ensures that Dune version 2 is used for the + build (this is the default; set to `false` to use Dune version 1). - It sets the optional `doCheck` attribute such that tests will be run with `dune runtest -p angstrom` after the build (`dune build -p angstrom`) is diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index 6bdec501630e..18e8784cfab3 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -2,7 +2,7 @@ { pname, version, nativeBuildInputs ? [], enableParallelBuilding ? true, ... }@args: -let Dune = if args.useDune2 or false then dune_2 else dune_1; in +let Dune = if args.useDune2 or true then dune_2 else dune_1; in if (args ? minimumOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion) || (args ? minimalOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimalOCamlVersion) diff --git a/pkgs/development/ocaml-modules/facile/default.nix b/pkgs/development/ocaml-modules/facile/default.nix index 8834de53a8fa..df228603e9f4 100644 --- a/pkgs/development/ocaml-modules/facile/default.nix +++ b/pkgs/development/ocaml-modules/facile/default.nix @@ -4,6 +4,8 @@ buildDunePackage rec { pname = "facile"; version = "1.1.4"; + useDune2 = false; + src = fetchurl { url = "https://github.com/Emmanuel-PLF/facile/releases/download/${version}/facile-${version}.tbz"; sha256 = "0jqrwmn6fr2vj2rrbllwxq4cmxykv7zh0y4vnngx29f5084a04jp"; diff --git a/pkgs/development/ocaml-modules/genspio/default.nix b/pkgs/development/ocaml-modules/genspio/default.nix index db3c42bca36c..963cd1dab138 100644 --- a/pkgs/development/ocaml-modules/genspio/default.nix +++ b/pkgs/development/ocaml-modules/genspio/default.nix @@ -6,6 +6,8 @@ buildDunePackage rec { pname = "genspio"; version = "0.0.2"; + useDune2 = false; + src = fetchFromGitHub { owner = "hammerlab"; repo = pname; @@ -13,7 +15,7 @@ buildDunePackage rec { sha256 = "0cp6p1f713sfv4p2r03bzvjvakzn4ili7hf3a952b3w1k39hv37x"; }; - minimumOCamlVersion = "4.03"; + minimalOCamlVersion = "4.03"; propagatedBuildInputs = [ nonstd sosa ]; diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage.nix b/pkgs/development/ocaml-modules/janestreet/janePackage.nix index 63c4a900fced..da2687576015 100644 --- a/pkgs/development/ocaml-modules/janestreet/janePackage.nix +++ b/pkgs/development/ocaml-modules/janestreet/janePackage.nix @@ -5,7 +5,9 @@ buildDunePackage (args // { inherit version buildInputs; - minimumOCamlVersion = "4.04"; + useDune2 = false; + + minimalOCamlVersion = "4.04"; src = fetchFromGitHub { owner = "janestreet"; diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix index 3d280a509acc..5b9186835701 100644 --- a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix +++ b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix @@ -5,6 +5,8 @@ buildDunePackage (args // { inherit version; + useDune2 = false; + minimalOCamlVersion = "4.07"; src = fetchFromGitHub { diff --git a/pkgs/development/ocaml-modules/lwt/camlp4.nix b/pkgs/development/ocaml-modules/lwt/camlp4.nix index 88bb3d6759a0..e48d7cfa185a 100644 --- a/pkgs/development/ocaml-modules/lwt/camlp4.nix +++ b/pkgs/development/ocaml-modules/lwt/camlp4.nix @@ -11,7 +11,9 @@ buildDunePackage rec { sha256 = "1lv8z6ljfy47yvxmwf5jrvc5d3dc90r1n291x53j161sf22ddrk9"; }; - minimumOCamlVersion = "4.02"; + useDune2 = false; + + minimalOCamlVersion = "4.02"; propagatedBuildInputs = [ camlp4 ]; diff --git a/pkgs/development/ocaml-modules/nonstd/default.nix b/pkgs/development/ocaml-modules/nonstd/default.nix index 9de535154eeb..82b1feed540b 100644 --- a/pkgs/development/ocaml-modules/nonstd/default.nix +++ b/pkgs/development/ocaml-modules/nonstd/default.nix @@ -4,7 +4,9 @@ buildDunePackage rec { pname = "nonstd"; version = "0.0.3"; - minimumOCamlVersion = "4.02"; + useDune2 = false; + + minimalOCamlVersion = "4.02"; src = fetchzip { url = "https://bitbucket.org/smondet/${pname}/get/${pname}.${version}.tar.gz"; diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix b/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix index a08aaac832e3..39f6d5f7aa2d 100644 --- a/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix +++ b/pkgs/development/tools/ocaml/js_of_ocaml/camlp4.nix @@ -6,6 +6,8 @@ buildDunePackage rec { version = "3.2.1"; pname = "js_of_ocaml-camlp4"; + useDune2 = false; + src = fetchFromGitHub { owner = "ocsigen"; repo = "js_of_ocaml"; From 961581fba4f2d09eb6109678db1fa7e03628c82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 13 Mar 2022 16:53:53 +0100 Subject: [PATCH 64/67] nixUnstable: 2.7pre20220221 -> 2.8pre20220311 --- pkgs/tools/package-management/nix/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index a6b7fa3a9008..8eb8fef82983 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -73,13 +73,13 @@ in lib.makeExtensible (self: { stable = self.nix_2_7; unstable = lib.lowPrio (common rec { - version = "2.7"; - suffix = "pre20220221_${lib.substring 0 7 src.rev}"; + version = "2.8"; + suffix = "pre20220311_${lib.substring 0 7 src.rev}"; src = fetchFromGitHub { owner = "NixOS"; repo = "nix"; - rev = "caf51729450d4c57d48ddbef8e855e9bf65f8792"; - sha256 = "sha256-2fbza6fWPjyTyVEqWIp0jk/Z4epjSDe1u4lbEu+v7Iw="; + rev = "d5322698a2abbc6d141e1d244e17b0d226a2f18b"; + sha256 = "sha256-7rQSktGC8+DmeyGOnzFMy1QwAYnw4JJphv+lEwFCwfU="; }; }); }) From 9d13bf5b1caedcee62cd7bb7fa71a61f0ba87403 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 6 Mar 2022 15:43:56 +0100 Subject: [PATCH 65/67] =?UTF-8?q?ocaml-ng.ocamlPackages=5F4=5F14.ocaml:=20?= =?UTF-8?q?init=20at=204.14.0-=CE=B21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/compilers/ocaml/4.14.nix | 9 +++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 pkgs/development/compilers/ocaml/4.14.nix diff --git a/pkgs/development/compilers/ocaml/4.14.nix b/pkgs/development/compilers/ocaml/4.14.nix new file mode 100644 index 000000000000..96e1c13d285b --- /dev/null +++ b/pkgs/development/compilers/ocaml/4.14.nix @@ -0,0 +1,9 @@ +import ./generic.nix { + major_version = "4"; + minor_version = "14"; + patch_version = "0-beta1"; + src = fetchTarball { + url = "https://caml.inria.fr/pub/distrib/ocaml-4.14/ocaml-4.14.0~beta1.tar.xz"; + sha256 = "0jiz20hb58jbbk8j38agx11ra4hg0v3prmzc5a9j70lm09mnzfcd"; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index c883066ced52..cc126dc320de 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1580,6 +1580,8 @@ in let inherit (pkgs) callPackage; in rec ocamlPackages_4_13 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.13.nix { }); + ocamlPackages_4_14 = mkOcamlPackages (callPackage ../development/compilers/ocaml/4.14.nix { }); + ocamlPackages_latest = ocamlPackages_4_13; ocamlPackages = ocamlPackages_4_13; From ad826d3b93b9f2d069beeb3c259d192146309ec3 Mon Sep 17 00:00:00 2001 From: Adam Joseph <54836058+a-m-joseph@users.noreply.github.com> Date: Sun, 13 Mar 2022 20:46:57 +0000 Subject: [PATCH 66/67] vte: respect the global systemdSupport flag This commit allows to compile vte without systemd (-D_systemd=false) if the systemdSupport attribute is set to false. This can be done globally in nixpkgs.conf, and is understood by other packages. See also PR #160972. --- pkgs/development/libraries/vte/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/vte/default.nix b/pkgs/development/libraries/vte/default.nix index 0411086c78c3..eae934a4ebb1 100644 --- a/pkgs/development/libraries/vte/default.nix +++ b/pkgs/development/libraries/vte/default.nix @@ -21,6 +21,7 @@ , zlib , icu , systemd +, systemdSupport ? stdenv.hostPlatform.isLinux }: stdenv.mkDerivation rec { @@ -63,6 +64,7 @@ stdenv.mkDerivation rec { pcre2 zlib icu + ] ++ lib.optionals systemdSupport [ systemd ]; @@ -73,6 +75,10 @@ stdenv.mkDerivation rec { pango ]; + mesonFlags = lib.optionals (!systemdSupport) [ + "-D_systemd=false" + ]; + postPatch = '' patchShebangs perf/* patchShebangs src/box_drawing_generate.sh From c32a688f82fbc01f489eeeb078621f7301e1e740 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sun, 13 Mar 2022 12:21:21 +1000 Subject: [PATCH 67/67] terraform-providers: refactor scripts - improve script output - use sri hashes, same as recent versions of `nix` --- .../terraform-providers/update-all-providers | 13 ++-- .../terraform-providers/update-provider | 70 +++++++++---------- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/pkgs/applications/networking/cluster/terraform-providers/update-all-providers b/pkgs/applications/networking/cluster/terraform-providers/update-all-providers index 57e1ab32f083..d7a05cf24a65 100755 --- a/pkgs/applications/networking/cluster/terraform-providers/update-all-providers +++ b/pkgs/applications/networking/cluster/terraform-providers/update-all-providers @@ -5,7 +5,7 @@ # Update all providers which have specified provider source address set -euo pipefail -providers=$( +readarray -t providers < <( jq -r 'to_entries | map_values(.value + { alias: .key }) | .[] @@ -13,10 +13,13 @@ providers=$( | .alias' providers.json ) -echo "Will update providers:" -echo "${providers}" +cat < read_attr() { - jq -r ".\"${provider_name}\".\"$1\"" providers.json + jq -r ".\"${provider}\".\"$1\"" providers.json } # Usage: update_attr update_attr() { if [[ $2 == "null" ]]; then - jq -S ".\"${provider_name}\".\"$1\" = null" providers.json | sponge providers.json + jq -S ".\"${provider}\".\"$1\" = null" providers.json | sponge providers.json else - jq -S ".\"${provider_name}\".\"$1\" = \"$2\"" providers.json | sponge providers.json + jq -S ".\"${provider}\".\"$1\" = \"$2\"" providers.json | sponge providers.json fi } -prefetch_github() { - # of a given owner, repo and rev, fetch the tarball and return the output of - # `nix-prefetch-url` - local owner=$1 - local repo=$2 - local rev=$3 - nix-prefetch-url --unpack "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz" +repo_root=$(git rev-parse --show-toplevel) + +generate_hash() { + nix-prefetch -I nixpkgs="${repo_root}" \ + "{ sha256 }: (import ${repo_root} {}).terraform-providers.${provider}.$1.overrideAttrs (_: { $2 = sha256; })" } -old_source_address="$(read_attr provider-source-address)" -old_vendor_sha256=$(read_attr vendorSha256) -old_version=$(read_attr version) +echo_provider() { + echo "== terraform-providers.${provider}: $* ==" +} if [[ ${provider} =~ ^[^/]+/[^/]+$ ]]; then + echo_provider "init" source_address=registry.terraform.io/${provider} + provider=$(basename "${provider}") + update_attr "provider-source-address" "${source_address}" + update_attr version "0" + # create empty stings so nix-prefetch works + update_attr sha256 "" + update_attr vendorSha256 "" else - source_address=${old_source_address} + source_address="$(read_attr provider-source-address)" fi -if [[ ${source_address} == "null" ]]; then - echo "Could not find the source address for provider: ${provider}" - exit 1 -fi -update_attr "provider-source-address" "${source_address}" + +old_vendor_sha256=$(read_attr vendorSha256) +old_version=$(read_attr version) # The provider source address (used inside Terraform `required_providers` block) is # used to compute the registry API endpoint @@ -125,8 +126,10 @@ registry_response=$(curl -s https://"${source_address/\///v1/providers/}") version="$(jq -r '.version' <<<"${registry_response}")" if [[ ${old_version} == "${version}" && ${force} != 1 && -z ${vendorSha256} && ${old_vendor_sha256} != "${vendorSha256}" ]]; then - echo "${provider_name} is already at version ${version}" + echo_provider "already at version ${version}" exit +else + echo_provider "updating from ${old_version} to ${version}" fi update_attr version "${version}" @@ -138,28 +141,23 @@ repo="$(echo "${provider_source_url}" | cut -d '/' -f 5)" update_attr repo "${repo}" rev="$(jq -r '.tag' <<<"${registry_response}")" update_attr rev "${rev}" -sha256=$(prefetch_github "${org}" "${repo}" "${rev}") +echo_provider "calculating sha256" +sha256=$(generate_hash src outputHash) update_attr sha256 "${sha256}" if [[ -z ${vendorSha256} ]]; then if [[ ${old_vendor_sha256} == null ]]; then vendorSha256=null - elif [[ -n ${old_vendor_sha256} ]]; then - echo "=== Calculating vendorSha256 ===" - vendorSha256=$(nix-prefetch -I nixpkgs=../../../../.. "{ sha256 }: (import ../../../../.. {}).terraform-providers.${provider_name}.go-modules.overrideAttrs (_: { vendorSha256 = sha256; })") - # Deal with nix unstable - if [[ ${vendorSha256} == sha256-* ]]; then - vendorSha256=$(nix --extra-experimental-features nix-command hash to-base32 "${vendorSha256}") - fi + else + echo_provider "calculating vendorSha256" + vendorSha256=$(generate_hash go-modules vendorSha256) fi fi -if [[ -n ${vendorSha256} ]]; then - update_attr vendorSha256 "${vendorSha256}" -fi +update_attr vendorSha256 "${vendorSha256}" # Check that the provider builds if [[ ${build} == 1 ]]; then - echo "=== Building terraform-providers.${provider_name} ===" - nix-build --no-out-link ../../../../.. -A "terraform-providers.${provider_name}" + echo_provider "building" + nix-build --no-out-link "${repo_root}" -A "terraform-providers.${provider}" fi