diff --git a/pkgs/by-name/ac/accountsservice/package.nix b/pkgs/by-name/ac/accountsservice/package.nix index 6456657b7afa..c236ebf9c706 100644 --- a/pkgs/by-name/ac/accountsservice/package.nix +++ b/pkgs/by-name/ac/accountsservice/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchurl, - substituteAll, + replaceVars, pkg-config, glib, shadow, @@ -36,8 +36,7 @@ stdenv.mkDerivation rec { patches = [ # Hardcode dependency paths. - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit shadow coreutils; }) diff --git a/pkgs/by-name/al/alvr/package.nix b/pkgs/by-name/al/alvr/package.nix index 61186040a144..5b72149d2aad 100644 --- a/pkgs/by-name/al/alvr/package.nix +++ b/pkgs/by-name/al/alvr/package.nix @@ -2,7 +2,7 @@ lib, rustPlatform, fetchFromGitHub, - substituteAll, + replaceVars, nix-update-script, pkg-config, autoAddDriverRunpath, @@ -59,8 +59,7 @@ rustPlatform.buildRustPackage rec { }; patches = [ - (substituteAll { - src = ./fix-finding-libs.patch; + (replaceVars ./fix-finding-libs.patch { ffmpeg = lib.getDev ffmpeg; x264 = lib.getDev x264; }) diff --git a/pkgs/by-name/ap/appstream-glib/package.nix b/pkgs/by-name/ap/appstream-glib/package.nix index 67f5f96c306e..1bee0504fcb8 100644 --- a/pkgs/by-name/ap/appstream-glib/package.nix +++ b/pkgs/by-name/ap/appstream-glib/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, docbook_xml_dtd_42, docbook_xsl, fontconfig, @@ -74,8 +74,7 @@ stdenv.mkDerivation rec { ]; patches = [ - (substituteAll { - src = ./paths.patch; + (replaceVars ./paths.patch { pngquant = "${pngquant}/bin/pngquant"; }) ]; diff --git a/pkgs/by-name/cc/ccache/package.nix b/pkgs/by-name/cc/ccache/package.nix index 1bee50d60c43..1143798f411e 100644 --- a/pkgs/by-name/cc/ccache/package.nix +++ b/pkgs/by-name/cc/ccache/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, binutils, asciidoctor, cmake, @@ -54,8 +54,7 @@ stdenv.mkDerivation (finalAttrs: { # Darwin. # Additionally, when cross compiling, the correct target prefix # needs to be set. - (substituteAll { - src = ./fix-objdump-path.patch; + (replaceVars ./fix-objdump-path.patch { objdump = "${binutils.bintools}/bin/${binutils.targetPrefix}objdump"; }) ]; diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index cae5089ffdfc..0ab0ec7868cf 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -1,7 +1,7 @@ { lib , stdenv , fetchurl -, substituteAll +, replaceVars , buildPackages , bzip2 , curlMinimal @@ -75,8 +75,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional stdenv.hostPlatform.isDarwin ./006-darwin-always-set-runtime-c-flag.diff # On platforms where ps is not part of stdenv, patch the invocation of ps to use an absolute path. ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) ( - substituteAll { - src = ./007-darwin-bsd-ps-abspath.diff; + replaceVars ./007-darwin-bsd-ps-abspath.diff { ps = lib.getExe ps; }) ++ [ diff --git a/pkgs/by-name/fl/flatpak/package.nix b/pkgs/by-name/fl/flatpak/package.nix index 7d31297d22b2..68946e0fa536 100644 --- a/pkgs/by-name/fl/flatpak/package.nix +++ b/pkgs/by-name/fl/flatpak/package.nix @@ -46,7 +46,7 @@ python3, shared-mime-info, socat, - substituteAll, + replaceVars, systemd, testers, valgrind, @@ -84,8 +84,7 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Hardcode paths used by tests and change test runtime generation to use files from Nix store. # https://github.com/flatpak/flatpak/issues/1460 - (substituteAll { - src = ./fix-test-paths.patch; + (replaceVars ./fix-test-paths.patch { inherit coreutils gettext @@ -98,8 +97,7 @@ stdenv.mkDerivation (finalAttrs: { }) # Hardcode paths used by Flatpak itself. - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { p11kit = "${p11-kit.bin}/bin/p11-kit"; }) @@ -235,8 +233,7 @@ stdenv.mkDerivation (finalAttrs: { ''; passthru = { - icon-validator-patch = substituteAll { - src = ./fix-icon-validation.patch; + icon-validator-patch = replaceVars ./fix-icon-validation.patch { inherit (builtins) storeDir; }; diff --git a/pkgs/by-name/fo/formatter/package.nix b/pkgs/by-name/fo/formatter/package.nix index 744a0499707a..634ca15c9c3e 100644 --- a/pkgs/by-name/fo/formatter/package.nix +++ b/pkgs/by-name/fo/formatter/package.nix @@ -9,7 +9,7 @@ pkg-config, pantheon, python3, - substituteAll, + replaceVars, glib, gtk3, dosfstools, @@ -33,8 +33,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { ext4 = "${e2fsprogs}/bin/mkfs.ext4"; exfat = "${exfat}/bin/mkfs.exfat"; fat = "${dosfstools}/bin/mkfs.fat"; diff --git a/pkgs/by-name/gd/gdm/package.nix b/pkgs/by-name/gd/gdm/package.nix index cdf66774135a..9dc9e6d439a1 100644 --- a/pkgs/by-name/gd/gdm/package.nix +++ b/pkgs/by-name/gd/gdm/package.nix @@ -3,7 +3,7 @@ stdenv, fetchurl, fetchpatch, - substituteAll, + replaceVars, meson, ninja, pkg-config, @@ -35,8 +35,7 @@ let - override = substituteAll { - src = ./org.gnome.login-screen.gschema.override; + override = replaceVars ./org.gnome.login-screen.gschema.override { icon = "${nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake-white.svg"; }; @@ -105,8 +104,7 @@ stdenv.mkDerivation (finalAttrs: { }) # Change hardcoded paths to nix store paths. - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit coreutils plymouth diff --git a/pkgs/by-name/gl/glib-networking/package.nix b/pkgs/by-name/gl/glib-networking/package.nix index 9bdaac3c3b4c..7aa64f0b0acf 100644 --- a/pkgs/by-name/gl/glib-networking/package.nix +++ b/pkgs/by-name/gl/glib-networking/package.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchurl, - substituteAll, + replaceVars, meson, ninja, nixosTests, @@ -33,8 +33,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./hardcode-gsettings.patch; + (replaceVars ./hardcode-gsettings.patch { gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas; }) diff --git a/pkgs/by-name/gn/gnome-control-center/package.nix b/pkgs/by-name/gn/gnome-control-center/package.nix index 090250d0cd23..981cd76dcdbe 100644 --- a/pkgs/by-name/gn/gnome-control-center/package.nix +++ b/pkgs/by-name/gn/gnome-control-center/package.nix @@ -2,7 +2,7 @@ fetchurl, lib, stdenv, - substituteAll, + replaceVars, accountsservice, adwaita-icon-theme, colord, @@ -82,8 +82,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./paths.patch; + (replaceVars ./paths.patch { gcm = gnome-color-manager; inherit glibc tzdata shadow; inherit cups networkmanagerapplet; diff --git a/pkgs/by-name/gn/gnome-desktop/package.nix b/pkgs/by-name/gn/gnome-desktop/package.nix index 2d533759f60e..a7b599ae12a5 100644 --- a/pkgs/by-name/gn/gnome-desktop/package.nix +++ b/pkgs/by-name/gn/gnome-desktop/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchurl, - substituteAll, + replaceVars, pkg-config, libxslt, ninja, @@ -44,8 +44,7 @@ stdenv.mkDerivation rec { }; patches = lib.optionals stdenv.hostPlatform.isLinux [ - (substituteAll { - src = ./bubblewrap-paths.patch; + (replaceVars ./bubblewrap-paths.patch { bubblewrap_bin = "${bubblewrap}/bin/bwrap"; inherit (builtins) storeDir; }) diff --git a/pkgs/by-name/gn/gnome-initial-setup/package.nix b/pkgs/by-name/gn/gnome-initial-setup/package.nix index 0d96d8c1b701..e93c679ec4de 100644 --- a/pkgs/by-name/gn/gnome-initial-setup/package.nix +++ b/pkgs/by-name/gn/gnome-initial-setup/package.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchurl, - substituteAll, + replaceVars, dconf, gettext, meson, @@ -45,8 +45,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./0001-fix-paths.patch; + (replaceVars ./0001-fix-paths.patch { inherit tzdata; tecla = gnome-tecla; }) diff --git a/pkgs/by-name/gn/gnome-pomodoro/package.nix b/pkgs/by-name/gn/gnome-pomodoro/package.nix index 6c7ee5e23431..1a8cfe51201d 100644 --- a/pkgs/by-name/gn/gnome-pomodoro/package.nix +++ b/pkgs/by-name/gn/gnome-pomodoro/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, meson, ninja, pkg-config, @@ -36,8 +36,7 @@ stdenv.mkDerivation rec { patches = [ # Our glib setup hooks moves GSettings schemas to a subdirectory to prevent conflicts. # We need to patch the build script so that the extension can find them. - (substituteAll { - src = ./fix-schema-path.patch; + (replaceVars ./fix-schema-path.patch { inherit pname version; }) ]; diff --git a/pkgs/by-name/gn/gnome-session/package.nix b/pkgs/by-name/gn/gnome-session/package.nix index 4b4967c263ee..47842a419a7b 100644 --- a/pkgs/by-name/gn/gnome-session/package.nix +++ b/pkgs/by-name/gn/gnome-session/package.nix @@ -2,7 +2,7 @@ fetchurl, lib, stdenv, - substituteAll, + replaceVars, meson, ninja, pkg-config, @@ -47,8 +47,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { gsettings = "${glib.bin}/bin/gsettings"; dbusLaunch = "${dbus.lib}/bin/dbus-launch"; bash = "${bash}/bin/bash"; diff --git a/pkgs/by-name/gn/gnome-settings-daemon/package.nix b/pkgs/by-name/gn/gnome-settings-daemon/package.nix index e07a354c20ba..dbeaeb1115c6 100644 --- a/pkgs/by-name/gn/gnome-settings-daemon/package.nix +++ b/pkgs/by-name/gn/gnome-settings-daemon/package.nix @@ -1,7 +1,7 @@ { stdenv, lib, - substituteAll, + replaceVars, buildPackages, fetchurl, meson, @@ -54,8 +54,7 @@ stdenv.mkDerivation (finalAttrs: { # https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202 ./add-gnome-session-ctl-option.patch - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit tzdata; }) ]; diff --git a/pkgs/by-name/gn/gnome-settings-daemon46/package.nix b/pkgs/by-name/gn/gnome-settings-daemon46/package.nix index d7b00a0a2ef9..31a4fdb73a1d 100644 --- a/pkgs/by-name/gn/gnome-settings-daemon46/package.nix +++ b/pkgs/by-name/gn/gnome-settings-daemon46/package.nix @@ -1,7 +1,7 @@ { stdenv, lib, - substituteAll, + replaceVars, fetchurl, meson, ninja, @@ -51,8 +51,7 @@ stdenv.mkDerivation (finalAttrs: { # https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202 ./add-gnome-session-ctl-option.patch - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit tzdata; }) ]; diff --git a/pkgs/by-name/gn/gnome-shell-extensions/package.nix b/pkgs/by-name/gn/gnome-shell-extensions/package.nix index 81e5cd2c8a34..2bc4bda52d9f 100644 --- a/pkgs/by-name/gn/gnome-shell-extensions/package.nix +++ b/pkgs/by-name/gn/gnome-shell-extensions/package.nix @@ -10,7 +10,7 @@ glib, gnome, gnome-menus, - substituteAll, + replaceVars, }: stdenv.mkDerivation (finalAttrs: { @@ -23,12 +23,10 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./fix_gmenu.patch; + (replaceVars ./fix_gmenu.patch { gmenu_path = "${gnome-menus}/lib/girepository-1.0"; }) - (substituteAll { - src = ./fix_gtop.patch; + (replaceVars ./fix_gtop.patch { gtop_path = "${libgtop}/lib/girepository-1.0"; }) ]; diff --git a/pkgs/by-name/gn/gnome-shell/package.nix b/pkgs/by-name/gn/gnome-shell/package.nix index e0db6fa1d6f1..ca1e5b62cf03 100644 --- a/pkgs/by-name/gn/gnome-shell/package.nix +++ b/pkgs/by-name/gn/gnome-shell/package.nix @@ -1,7 +1,7 @@ { fetchurl, fetchpatch, - substituteAll, + replaceVars, lib, stdenv, docutils, @@ -84,8 +84,7 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Hardcode paths to various dependencies so that they can be found at runtime. - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { glib_compile_schemas = "${glib.dev}/bin/glib-compile-schemas"; gsettings = "${glib.bin}/bin/gsettings"; tecla = "${lib.getBin gnome-tecla}/bin/tecla"; diff --git a/pkgs/by-name/gn/gnome-software/package.nix b/pkgs/by-name/gn/gnome-software/package.nix index d265ff11611d..7936fc9a164e 100644 --- a/pkgs/by-name/gn/gnome-software/package.nix +++ b/pkgs/by-name/gn/gnome-software/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchurl, - substituteAll, + replaceVars, pkg-config, meson, ninja, @@ -56,8 +56,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit isocodes; }) ]; diff --git a/pkgs/by-name/go/google-cloud-cpp/package.nix b/pkgs/by-name/go/google-cloud-cpp/package.nix index 83f55078d6a6..3b8a0fe9f0f4 100644 --- a/pkgs/by-name/go/google-cloud-cpp/package.nix +++ b/pkgs/by-name/go/google-cloud-cpp/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, c-ares, cmake, crc32c, @@ -43,8 +43,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./hardcode-googleapis-path.patch; + (replaceVars ./hardcode-googleapis-path.patch { url = googleapis; }) ]; diff --git a/pkgs/by-name/gp/gparted/package.nix b/pkgs/by-name/gp/gparted/package.nix index d5e5ffcc0ed7..2d5307de45f2 100644 --- a/pkgs/by-name/gp/gparted/package.nix +++ b/pkgs/by-name/gp/gparted/package.nix @@ -20,7 +20,7 @@ util-linux, polkit, wrapGAppsHook3, - substituteAll, + replaceVars, mtools, dosfstools, xhost, @@ -39,8 +39,7 @@ stdenv.mkDerivation rec { # however the binary won't be suid so it returns # an error preventing the program from detection patches = [ - (substituteAll { - src = ./polkit.patch; + (replaceVars ./polkit.patch { polkit_version = polkit.version; }) ]; diff --git a/pkgs/by-name/gu/gusb/package.nix b/pkgs/by-name/gu/gusb/package.nix index c13c40baed3d..bbc21fcc2104 100644 --- a/pkgs/by-name/gu/gusb/package.nix +++ b/pkgs/by-name/gu/gusb/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, meson, ninja, pkg-config, @@ -46,8 +46,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-python-path.patch; + (replaceVars ./fix-python-path.patch { python = "${pythonEnv}/bin/python3"; }) ]; diff --git a/pkgs/by-name/gv/gvfs/package.nix b/pkgs/by-name/gv/gvfs/package.nix index e70cccc2568b..7045b0f487b8 100644 --- a/pkgs/by-name/gv/gvfs/package.nix +++ b/pkgs/by-name/gv/gvfs/package.nix @@ -5,7 +5,7 @@ meson, ninja, pkg-config, - substituteAll, + replaceVars, gettext, dbus, glib, @@ -55,8 +55,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./hardcode-ssh-path.patch; + (replaceVars ./hardcode-ssh-path.patch { ssh_program = "${lib.getBin openssh}/bin/ssh"; }) ]; diff --git a/pkgs/by-name/ha/hare/package.nix b/pkgs/by-name/ha/hare/package.nix index 763d8638fd58..30472742a2a0 100644 --- a/pkgs/by-name/ha/hare/package.nix +++ b/pkgs/by-name/ha/hare/package.nix @@ -6,7 +6,7 @@ scdoc, tzdata, mailcap, - substituteAll, + replaceVars, callPackage, enableCrossCompilation ? (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.is64bit), pkgsCross, @@ -92,22 +92,19 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Replace FHS paths with nix store - (substituteAll { - src = ./001-tzdata.patch; + (replaceVars ./001-tzdata.patch { inherit tzdata; }) # Don't build haredoc since it uses the build `hare` bin, which breaks # cross-compilation. ./002-dont-build-haredoc.patch # Hardcode harec and qbe. - (substituteAll { - src = ./003-hardcode-qbe-and-harec.patch; + (replaceVars ./003-hardcode-qbe-and-harec.patch { harec_bin = lib.getExe harec; qbe_bin = lib.getExe qbe; }) # Use mailcap `/etc/mime.types` for Hare's mime module - (substituteAll { - src = ./004-use-mailcap-for-mimetypes.patch; + (replaceVars ./004-use-mailcap-for-mimetypes.patch { inherit mailcap; }) ]; diff --git a/pkgs/by-name/ha/haredo/package.nix b/pkgs/by-name/ha/haredo/package.nix index a6ef926c85b9..ee937f9a0c3c 100644 --- a/pkgs/by-name/ha/haredo/package.nix +++ b/pkgs/by-name/ha/haredo/package.nix @@ -7,7 +7,7 @@ nix-update-script, makeWrapper, bash, - substituteAll, + replaceVars, }: stdenv.mkDerivation (finalAttrs: { pname = "haredo"; @@ -27,8 +27,7 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Use nix store's bash instead of sh. `@bash@/bin/sh` is used, since haredo expects a posix shell. - (substituteAll { - src = ./001-use-nix-store-sh.patch; + (replaceVars ./001-use-nix-store-sh.patch { inherit bash; }) ]; diff --git a/pkgs/by-name/ho/howard-hinnant-date/package.nix b/pkgs/by-name/ho/howard-hinnant-date/package.nix index 0387bad95e0e..d4bc072db377 100644 --- a/pkgs/by-name/ho/howard-hinnant-date/package.nix +++ b/pkgs/by-name/ho/howard-hinnant-date/package.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, tzdata, fetchpatch, substituteAll }: +{ lib, stdenv, fetchFromGitHub, cmake, tzdata, fetchpatch, replaceVars }: stdenv.mkDerivation rec { pname = "howard-hinnant-date"; @@ -22,8 +22,7 @@ stdenv.mkDerivation rec { # Without this patch, this library will drop a `tzdata` directory into # `~/Downloads` if it cannot find `/usr/share/zoneinfo`. Make the path it # searches for `zoneinfo` be the one from the `tzdata` package. - (substituteAll { - src = ./make-zoneinfo-available.diff; + (replaceVars ./make-zoneinfo-available.diff { inherit tzdata; }) ]; diff --git a/pkgs/by-name/in/iniparser/package.nix b/pkgs/by-name/in/iniparser/package.nix index b0bb4dce192f..ca36474af0d9 100644 --- a/pkgs/by-name/in/iniparser/package.nix +++ b/pkgs/by-name/in/iniparser/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitLab, fetchFromGitHub, - substituteAll, + replaceVars, symlinkJoin, cmake, doxygen, @@ -24,9 +24,8 @@ stdenv.mkDerivation (finalAttrs: { }; patches = lib.optionals finalAttrs.finalPackage.doCheck [ - (substituteAll { + (replaceVars ./remove-fetchcontent-usage.patch { # Do not let cmake's fetchContent download unity - src = ./remove-fetchcontent-usage.patch; unitySrc = symlinkJoin { name = "unity-with-iniparser-config"; paths = [ diff --git a/pkgs/by-name/is/isc-cron/package.nix b/pkgs/by-name/is/isc-cron/package.nix index 61633c6c9c88..94d25e516500 100644 --- a/pkgs/by-name/is/isc-cron/package.nix +++ b/pkgs/by-name/is/isc-cron/package.nix @@ -2,7 +2,7 @@ lib, fetchurl, stdenv, - substituteAll, + replaceVars, vim, sendmailPath ? "/usr/sbin/sendmail", }: @@ -17,8 +17,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./0000-nixpkgs-specific.diff; + (replaceVars ./0000-nixpkgs-specific.diff { inherit sendmailPath; viPath = lib.getExe' vim "vim"; defPath = lib.concatStringsSep ":" [ diff --git a/pkgs/by-name/jo/john/package.nix b/pkgs/by-name/jo/john/package.nix index 5f27e61ec39f..7fb41a69d582 100644 --- a/pkgs/by-name/jo/john/package.nix +++ b/pkgs/by-name/jo/john/package.nix @@ -19,7 +19,7 @@ ocl-icd, # include non-free ClamAV unrar code enableUnfree ? false, - substituteAll, + replaceVars, makeWrapper, }: @@ -35,8 +35,7 @@ stdenv.mkDerivation rec { }; patches = lib.optionals withOpenCL [ - (substituteAll { - src = ./opencl.patch; + (replaceVars ./opencl.patch { ocl_icd = ocl-icd; }) ]; diff --git a/pkgs/by-name/ke/keepass/package.nix b/pkgs/by-name/ke/keepass/package.nix index fc3bd1ff7fe6..e7bfa51c4923 100644 --- a/pkgs/by-name/ke/keepass/package.nix +++ b/pkgs/by-name/ke/keepass/package.nix @@ -6,7 +6,7 @@ mono, makeWrapper, icoutils, - substituteAll, + replaceVars, xsel, xorg, xdotool, @@ -37,8 +37,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ icoutils ]; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { xsel = "${xsel}/bin/xsel"; xprop = "${xorg.xprop}/bin/xprop"; xdotool = "${xdotool}/bin/xdotool"; diff --git a/pkgs/by-name/la/lalrpop/package.nix b/pkgs/by-name/la/lalrpop/package.nix index dc523c5967e6..c7c97c7880b9 100644 --- a/pkgs/by-name/la/lalrpop/package.nix +++ b/pkgs/by-name/la/lalrpop/package.nix @@ -2,7 +2,7 @@ lib, rustPlatform, fetchFromGitHub, - substituteAll, + replaceVars, stdenv, }: @@ -20,8 +20,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-zkPLas+fQQzm7LlWNpTooUR/e30KMS9OET6PMwQ2yAA="; patches = [ - (substituteAll { - src = ./use-correct-binary-path-in-tests.patch; + (replaceVars ./use-correct-binary-path-in-tests.patch { target_triple = stdenv.hostPlatform.rust.rustcTarget; }) ]; diff --git a/pkgs/by-name/li/libosinfo/package.nix b/pkgs/by-name/li/libosinfo/package.nix index 93cb538b5909..c48b1d2c739a 100644 --- a/pkgs/by-name/li/libosinfo/package.nix +++ b/pkgs/by-name/li/libosinfo/package.nix @@ -19,7 +19,7 @@ perl, hwdata, osinfo-db, - substituteAll, + replaceVars, vala ? null, }: @@ -61,8 +61,7 @@ stdenv.mkDerivation rec { ]; patches = [ - (substituteAll { - src = ./osinfo-db-data-dir.patch; + (replaceVars ./osinfo-db-data-dir.patch { osinfo_db_data_dir = "${osinfo-db}/share"; }) diff --git a/pkgs/by-name/me/metacity/package.nix b/pkgs/by-name/me/metacity/package.nix index ecdf42ecbad6..8a7248287a8d 100644 --- a/pkgs/by-name/me/metacity/package.nix +++ b/pkgs/by-name/me/metacity/package.nix @@ -13,7 +13,7 @@ libstartup_notification, libxml2, pkg-config, - substituteAll, + replaceVars, wrapGAppsHook3, zenity, }: @@ -28,8 +28,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit zenity; }) ]; diff --git a/pkgs/by-name/mi/minigalaxy/package.nix b/pkgs/by-name/mi/minigalaxy/package.nix index 05ff14a6b82d..131bd375418b 100644 --- a/pkgs/by-name/mi/minigalaxy/package.nix +++ b/pkgs/by-name/mi/minigalaxy/package.nix @@ -8,7 +8,7 @@ libnotify, python3Packages, steam-run, - substituteAll, + replaceVars, unzip, webkitgtk_4_0, wrapGAppsHook3, @@ -26,8 +26,7 @@ python3Packages.buildPythonApplication rec { }; patches = [ - (substituteAll { - src = ./inject-launcher-steam-run.diff; + (replaceVars ./inject-launcher-steam-run.diff { steamrun = lib.getExe steam-run; }) ]; diff --git a/pkgs/by-name/mi/mirakurun/package.nix b/pkgs/by-name/mi/mirakurun/package.nix index c01ea18ba8c6..0ae8bc87856c 100644 --- a/pkgs/by-name/mi/mirakurun/package.nix +++ b/pkgs/by-name/mi/mirakurun/package.nix @@ -7,7 +7,7 @@ installShellFiles, makeWrapper, nodejs, - substituteAll, + replaceVars, v4l-utils, which, }: @@ -46,8 +46,7 @@ buildNpmPackage rec { nodejs which ] ++ lib.optionals stdenv.hostPlatform.isLinux [ v4l-utils ]; - crc32Patch = substituteAll { - src = ./fix-musl-detection.patch; + crc32Patch = replaceVars ./fix-musl-detection.patch { isMusl = if stdenv.hostPlatform.isMusl then "true" else "false"; }; in diff --git a/pkgs/by-name/mu/muffin/package.nix b/pkgs/by-name/mu/muffin/package.nix index 69654afc27e3..ad233c8a85aa 100644 --- a/pkgs/by-name/mu/muffin/package.nix +++ b/pkgs/by-name/mu/muffin/package.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchFromGitHub, - substituteAll, + replaceVars, cairo, cinnamon-desktop, dbus, @@ -58,8 +58,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit zenity; }) ]; diff --git a/pkgs/by-name/mu/music-assistant/package.nix b/pkgs/by-name/mu/music-assistant/package.nix index 20c46046506d..69c5e8566c7a 100644 --- a/pkgs/by-name/mu/music-assistant/package.nix +++ b/pkgs/by-name/mu/music-assistant/package.nix @@ -4,7 +4,7 @@ fetchFromGitHub, ffmpeg-headless, nixosTests, - substituteAll, + replaceVars, providers ? [ ], }: @@ -38,8 +38,7 @@ python.pkgs.buildPythonApplication rec { }; patches = [ - (substituteAll { - src = ./ffmpeg.patch; + (replaceVars ./ffmpeg.patch { ffmpeg = "${lib.getBin ffmpeg-headless}/bin/ffmpeg"; ffprobe = "${lib.getBin ffmpeg-headless}/bin/ffprobe"; }) diff --git a/pkgs/by-name/na/nautilus-python/package.nix b/pkgs/by-name/na/nautilus-python/package.nix index f501181da597..ccc6f2d23e5e 100644 --- a/pkgs/by-name/na/nautilus-python/package.nix +++ b/pkgs/by-name/na/nautilus-python/package.nix @@ -1,7 +1,7 @@ { stdenv, lib, - substituteAll, + replaceVars, fetchurl, meson, ninja, @@ -32,8 +32,7 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Make PyGObject’s gi library available. - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [ python3.pkgs.pygobject3 ]; diff --git a/pkgs/by-name/nu/nut/package.nix b/pkgs/by-name/nu/nut/package.nix index 998549a84e96..bdb6a0f792ef 100644 --- a/pkgs/by-name/nu/nut/package.nix +++ b/pkgs/by-name/nu/nut/package.nix @@ -17,7 +17,7 @@ net-snmp, openssl, pkg-config, - substituteAll, + replaceVars, systemd, udev, gnused, @@ -40,8 +40,7 @@ stdenv.mkDerivation rec { # trying to install directly into /etc/nut which predictably fails ./nutshutdown-conf-default.patch - (substituteAll { - src = ./hardcode-paths.patch; + (replaceVars ./hardcode-paths.patch { avahi = "${avahi}/lib"; freeipmi = "${freeipmi}/lib"; libgpiod = "${libgpiod_1}/lib"; diff --git a/pkgs/by-name/oc/octoprint/package.nix b/pkgs/by-name/oc/octoprint/package.nix index e3fd3bc3bdee..4a9d9b5d02b7 100644 --- a/pkgs/by-name/oc/octoprint/package.nix +++ b/pkgs/by-name/oc/octoprint/package.nix @@ -6,7 +6,7 @@ fetchFromGitHub, fetchPypi, python3, - substituteAll, + replaceVars, nix-update-script, nixosTests, # To include additional plugins, pass them here as an overlay. @@ -194,14 +194,12 @@ let patches = [ # substitute pip and let it find out, that it can't write anywhere - (substituteAll { - src = ./pip-path.patch; + (replaceVars ./pip-path.patch { pip = "${self.pip}/bin/pip"; }) # hardcore path to ffmpeg and hide related settings - (substituteAll { - src = ./ffmpeg-path.patch; + (replaceVars ./ffmpeg-path.patch { ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg"; }) ]; diff --git a/pkgs/by-name/on/onboard/package.nix b/pkgs/by-name/on/onboard/package.nix index 57fcce1ca6ea..7a2e35306d84 100644 --- a/pkgs/by-name/on/onboard/package.nix +++ b/pkgs/by-name/on/onboard/package.nix @@ -3,7 +3,7 @@ fetchpatch, stdenv, lib, - substituteAll, + replaceVars, aspellWithDicts, at-spi2-core ? null, atspiSupport ? true, @@ -51,8 +51,7 @@ python3.pkgs.buildPythonApplication rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit mousetweaks; }) # Allow loading hunspell dictionaries installed in NixOS system path diff --git a/pkgs/by-name/or/orca/package.nix b/pkgs/by-name/or/orca/package.nix index 2865233be1c6..4d20ca75d163 100644 --- a/pkgs/by-name/or/orca/package.nix +++ b/pkgs/by-name/or/orca/package.nix @@ -12,7 +12,7 @@ python3, gtk3, gnome, - substituteAll, + replaceVars, at-spi2-atk, at-spi2-core, dbus, @@ -39,8 +39,7 @@ python3.pkgs.buildPythonApplication rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { cat = "${coreutils}/bin/cat"; lsof = "${lsof}/bin/lsof"; pgrep = "${procps}/bin/pgrep"; diff --git a/pkgs/by-name/pa/patchPpdFilesHook/test.nix b/pkgs/by-name/pa/patchPpdFilesHook/test.nix index edb324ecdd8f..ae49114a296a 100644 --- a/pkgs/by-name/pa/patchPpdFilesHook/test.nix +++ b/pkgs/by-name/pa/patchPpdFilesHook/test.nix @@ -1,21 +1,19 @@ { - substituteAll, + replaceVars, diffutils, stdenv, patchPpdFilesHook, }: let - input = substituteAll { - src = ./test.ppd; + input = replaceVars ./test.ppd { keep = "cmp"; patch = "cmp"; pathkeep = "/bin/cmp"; pathpatch = "/bin/cmp"; }; - output = substituteAll { - src = ./test.ppd; + output = replaceVars ./test.ppd { keep = "cmp"; patch = "${diffutils}/bin/cmp"; pathkeep = "/bin/cmp"; diff --git a/pkgs/by-name/pl/plymouth/package.nix b/pkgs/by-name/pl/plymouth/package.nix index ae5e4ee2339c..27251284df3f 100644 --- a/pkgs/by-name/pl/plymouth/package.nix +++ b/pkgs/by-name/pl/plymouth/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitLab, writeText, - substituteAll, + replaceVars, meson, pkg-config, ninja, @@ -44,8 +44,7 @@ stdenv.mkDerivation (finalAttrs: { # add support for loading plugins from /run to assist NixOS module ./add-runtime-plugin-path.patch # fix FHS hardcoded paths - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { fcmatch = "${fontconfig}/bin/fc-match"; }) ]; diff --git a/pkgs/by-name/po/podman/package.nix b/pkgs/by-name/po/podman/package.nix index 3786188d9f0b..428c57edbd5a 100644 --- a/pkgs/by-name/po/podman/package.nix +++ b/pkgs/by-name/po/podman/package.nix @@ -19,7 +19,7 @@ makeWrapper, runtimeShell, symlinkJoin, - substituteAll, + replaceVars, extraPackages ? [ ], crun, runc, @@ -85,8 +85,7 @@ buildGoModule rec { }; patches = [ - (substituteAll { - src = ./hardcode-paths.patch; + (replaceVars ./hardcode-paths.patch { bin_path = helpersBin; }) diff --git a/pkgs/by-name/pr/pretix/plugins/passbook.nix b/pkgs/by-name/pr/pretix/plugins/passbook.nix index d5ca08315f18..d890a71f46ce 100644 --- a/pkgs/by-name/pr/pretix/plugins/passbook.nix +++ b/pkgs/by-name/pr/pretix/plugins/passbook.nix @@ -2,7 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, - substituteAll, + replaceVars, # build-system pretix-plugin-build, @@ -29,8 +29,7 @@ buildPythonPackage rec { }; patches = [ - (substituteAll { - src = ./passbook-openssl.patch; + (replaceVars ./passbook-openssl.patch { openssl = lib.getExe openssl; }) ]; diff --git a/pkgs/by-name/st/streamlink/package.nix b/pkgs/by-name/st/streamlink/package.nix index 12bdb22405ec..af58119e5228 100644 --- a/pkgs/by-name/st/streamlink/package.nix +++ b/pkgs/by-name/st/streamlink/package.nix @@ -2,7 +2,7 @@ lib, python3Packages, fetchPypi, - substituteAll, + replaceVars, ffmpeg, }: @@ -17,8 +17,7 @@ python3Packages.buildPythonApplication rec { }; patches = [ - (substituteAll { - src = ./ffmpeg-path.patch; + (replaceVars ./ffmpeg-path.patch { ffmpeg = lib.getExe ffmpeg; }) ]; diff --git a/pkgs/by-name/sw/sway-unwrapped/package.nix b/pkgs/by-name/sw/sway-unwrapped/package.nix index 5c92b8ac5848..482d8b8fb550 100644 --- a/pkgs/by-name/sw/sway-unwrapped/package.nix +++ b/pkgs/by-name/sw/sway-unwrapped/package.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, substituteAll, swaybg +{ lib, stdenv, fetchFromGitHub, fetchpatch, replaceVars, swaybg , meson, ninja, pkg-config, wayland-scanner, scdoc , libGL, wayland, libxkbcommon, pcre2, json_c, libevdev , pango, cairo, libinput, gdk-pixbuf, librsvg @@ -26,8 +26,7 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./load-configuration-from-etc.patch - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit swaybg; }) diff --git a/pkgs/by-name/sw/swayfx-unwrapped/package.nix b/pkgs/by-name/sw/swayfx-unwrapped/package.nix index f771a0101e24..0742dec1df1e 100644 --- a/pkgs/by-name/sw/swayfx-unwrapped/package.nix +++ b/pkgs/by-name/sw/swayfx-unwrapped/package.nix @@ -4,7 +4,7 @@ stdenv, systemd, meson, - substituteAll, + replaceVars, swaybg, ninja, pkg-config, @@ -57,8 +57,7 @@ stdenv.mkDerivation (finalAttrs: { [ ./load-configuration-from-etc.patch - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit swaybg; }) ] diff --git a/pkgs/by-name/um/umockdev/package.nix b/pkgs/by-name/um/umockdev/package.nix index 99086e0f2788..0423783df48f 100644 --- a/pkgs/by-name/um/umockdev/package.nix +++ b/pkgs/by-name/um/umockdev/package.nix @@ -13,7 +13,7 @@ ninja, pkg-config, python3, - substituteAll, + replaceVars, systemdMinimal, usbutils, vala, @@ -44,8 +44,7 @@ stdenv.mkDerivation (finalAttrs: { # Replace references to udevadm with an absolute paths, so programs using # umockdev will just work without having to provide it in their test environment # $PATH. - (substituteAll { - src = ./substitute-udevadm.patch; + (replaceVars ./substitute-udevadm.patch { udevadm = "${systemdMinimal}/bin/udevadm"; }) ]; diff --git a/pkgs/by-name/xs/xscreensaver/package.nix b/pkgs/by-name/xs/xscreensaver/package.nix index f3528d816090..40c26029e8e7 100644 --- a/pkgs/by-name/xs/xscreensaver/package.nix +++ b/pkgs/by-name/xs/xscreensaver/package.nix @@ -29,7 +29,7 @@ forceInstallAllHacks ? true, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, nixosTests, - substituteAll, + replaceVars, wrapperPrefix ? "/run/wrappers/bin", }: @@ -83,8 +83,7 @@ stdenv.mkDerivation (finalAttrs: { ''; patches = [ - (substituteAll { - src = ./xscreensaver-wrapper-prefix.patch; + (replaceVars ./xscreensaver-wrapper-prefix.patch { inherit wrapperPrefix; }) ];