From ebd18cf115cc212d9780092e9207e19b800f67a0 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 14 Dec 2024 22:09:44 +0100 Subject: [PATCH] treewide: replace substituteAll with replaceVars (#1) Driving #237216 forward. --- pkgs/applications/audio/easyabc/default.nix | 5 ++--- .../manual-packages/lsp-bridge/default.nix | 5 ++--- pkgs/applications/gis/qgis/unwrapped-ltr.nix | 5 ++--- pkgs/applications/gis/qgis/unwrapped.nix | 5 ++--- pkgs/applications/graphics/leocad/default.nix | 5 ++--- pkgs/applications/graphics/qvge/default.nix | 5 ++--- pkgs/applications/kde/kdenlive/default.nix | 5 ++--- pkgs/applications/misc/dmensamenu/default.nix | 5 ++--- pkgs/applications/misc/inochi2d/default.nix | 5 ++--- pkgs/applications/misc/mysql-workbench/default.nix | 8 +++----- .../irc/weechat/scripts/multiline/default.nix | 5 ++--- .../irc/weechat/scripts/wee-slack/default.nix | 5 ++--- .../irc/weechat/scripts/weechat-otr/default.nix | 5 ++--- .../mailreaders/evolution/evolution-ews/default.nix | 5 ++--- pkgs/applications/office/activitywatch/default.nix | 8 +++----- pkgs/applications/science/math/caffe/default.nix | 11 ++++++----- pkgs/applications/science/misc/cytoscape/default.nix | 5 ++--- .../virtualization/singularity/generic.nix | 5 ++--- pkgs/by-name/an/ansible-cmdb/package.nix | 5 ++--- pkgs/by-name/ar/argyllcms/package.nix | 5 ++--- pkgs/by-name/au/auto-cpufreq/package.nix | 5 ++--- pkgs/by-name/ba/bashblog/package.nix | 5 ++--- pkgs/by-name/bc/bcache-tools/package.nix | 5 ++--- pkgs/by-name/bo/bonnmotion/package.nix | 5 ++--- pkgs/by-name/bu/budgie-session/package.nix | 5 ++--- pkgs/by-name/ca/cargo-benchcmp/package.nix | 5 ++--- pkgs/by-name/ch/chawan/package.nix | 5 ++--- pkgs/by-name/cj/cjdns/package.nix | 5 ++--- pkgs/by-name/co/cosmopolitan/package.nix | 5 ++--- pkgs/by-name/cu/curseradio/package.nix | 5 ++--- pkgs/by-name/da/davfs2/package.nix | 8 +++----- pkgs/by-name/dc/dcm2niix/package.nix | 5 ++--- pkgs/by-name/de/deja-dup/package.nix | 5 ++--- pkgs/by-name/el/elvish/tests/expect-version.nix | 5 ++--- pkgs/by-name/eq/equibop/package.nix | 11 ++++++----- pkgs/by-name/fe/febio/package.nix | 5 ++--- pkgs/by-name/fl/flottbot/package.nix | 5 ++--- pkgs/by-name/fx/fxlinuxprintutil/package.nix | 5 ++--- pkgs/by-name/ga/gammu/package.nix | 5 ++--- pkgs/by-name/gl/glycin-loaders/package.nix | 5 ++--- pkgs/by-name/go/govulncheck/package.nix | 5 ++--- pkgs/by-name/gr/grilo-plugins/package.nix | 5 ++--- pkgs/by-name/hp/hplip/package.nix | 5 ++--- pkgs/by-name/hy/hypnotix/package.nix | 5 ++--- pkgs/by-name/ka/kazam/package.nix | 5 ++--- pkgs/by-name/li/libelfin/package.nix | 5 ++--- pkgs/by-name/li/libpam-wrapper/package.nix | 5 ++--- pkgs/by-name/li/librum/package.nix | 5 ++--- pkgs/by-name/li/libvpl/package.nix | 5 ++--- pkgs/by-name/li/likwid/package.nix | 5 ++--- pkgs/by-name/lu/luaformatter/package.nix | 5 ++--- .../by-name/ne/networkmanager-fortisslvpn/package.nix | 5 ++--- pkgs/by-name/ne/networkmanager-iodine/package.nix | 5 ++--- pkgs/by-name/ne/networkmanager-l2tp/package.nix | 5 ++--- .../by-name/ne/networkmanager-openconnect/package.nix | 5 ++--- pkgs/by-name/ne/networkmanager-openvpn/package.nix | 5 ++--- pkgs/by-name/ne/networkmanager-vpnc/package.nix | 5 ++--- pkgs/by-name/ni/nitter/package.nix | 5 ++--- pkgs/by-name/no/novnc/package.nix | 5 ++--- pkgs/by-name/on/onionshare-gui/package.nix | 5 ++--- pkgs/by-name/on/onionshare/package.nix | 5 ++--- pkgs/by-name/or/org-stats/package.nix | 5 ++--- pkgs/by-name/pa/passage/package.nix | 5 ++--- pkgs/by-name/pi/pika-backup/package.nix | 5 ++--- pkgs/by-name/r1/r128gain/package.nix | 5 ++--- pkgs/by-name/rt/rtfm/package.nix | 5 ++--- pkgs/by-name/sc/scanservjs/package.nix | 5 ++--- pkgs/by-name/sh/shotcut/package.nix | 5 ++--- pkgs/by-name/si/sing-geosite/package.nix | 5 ++--- pkgs/by-name/si/siyuan/package.nix | 5 ++--- pkgs/by-name/st/static-server/package.nix | 5 ++--- pkgs/by-name/st/stumpish/package.nix | 5 ++--- pkgs/by-name/te/teavpn2/package.nix | 5 ++--- .../by-name/ty/typescript-language-server/package.nix | 5 ++--- pkgs/by-name/vd/vdhcoapp/package.nix | 5 ++--- pkgs/by-name/ve/veracrypt/package.nix | 5 ++--- pkgs/by-name/ve/vesktop/package.nix | 11 ++++++----- pkgs/by-name/vy/vym/package.nix | 5 ++--- pkgs/by-name/we/webcord-vencord/package.nix | 5 ++--- .../wi/wingpanel-indicator-ayatana/package.nix | 5 ++--- pkgs/by-name/xb/xborders/package.nix | 5 ++--- pkgs/by-name/yo/you-get/package.nix | 5 ++--- pkgs/by-name/zs/zsh-powerlevel10k/package.nix | 5 ++--- pkgs/games/warsow/engine.nix | 5 ++--- pkgs/misc/my-env/default.nix | 5 ++--- pkgs/misc/tmux-plugins/tmux-fingers/default.nix | 5 ++--- pkgs/misc/tmux-plugins/tmux-thumbs/default.nix | 5 ++--- .../servers/sql/postgresql/ext/pgvecto-rs/default.nix | 5 ++--- pkgs/tools/audio/yabridge/default.nix | 5 ++--- pkgs/tools/graphics/mangohud/default.nix | 5 ++--- pkgs/tools/graphics/nifskope/default.nix | 5 ++--- .../inputmethods/ibus-engines/ibus-hangul/default.nix | 5 ++--- pkgs/tools/networking/bitmask-vpn/default.nix | 5 ++--- pkgs/tools/networking/ebpf-verifier/default.nix | 5 ++--- pkgs/tools/networking/edgedb/default.nix | 5 ++--- .../tools/package-management/protontricks/default.nix | 5 ++--- pkgs/tools/security/keybase/default.nix | 5 ++--- 97 files changed, 209 insertions(+), 303 deletions(-) diff --git a/pkgs/applications/audio/easyabc/default.nix b/pkgs/applications/audio/easyabc/default.nix index 10af7b23b9d53..16026b12750dc 100644 --- a/pkgs/applications/audio/easyabc/default.nix +++ b/pkgs/applications/audio/easyabc/default.nix @@ -2,7 +2,7 @@ lib, fetchFromGitHub, fetchPypi, - substituteAll, + replaceVars, python39, fluidsynth, soundfont-fluid, @@ -58,8 +58,7 @@ python.pkgs.buildPythonApplication { strictDeps = false; patches = [ - (substituteAll { - src = ./hardcoded-paths.patch; + (replaceVars ./hardcoded-paths.patch { fluidsynth = "${fluidsynth}/lib/libfluidsynth.so"; soundfont = "${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2"; ghostscript = "${ghostscript}/bin/gs"; diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix index c077089f75518..ce92bd1908398 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix @@ -3,7 +3,7 @@ python3, melpaBuild, fetchFromGitHub, - substituteAll, + replaceVars, acm, markdown-mode, basedpyright, @@ -42,8 +42,7 @@ melpaBuild { patches = [ # Hardcode the python dependencies needed for lsp-bridge, so users # don't have to modify their global environment - (substituteAll { - src = ./hardcode-dependencies.patch; + (replaceVars ./hardcode-dependencies.patch { python = python.interpreter; }) ]; diff --git a/pkgs/applications/gis/qgis/unwrapped-ltr.nix b/pkgs/applications/gis/qgis/unwrapped-ltr.nix index 6806ba5d41e4d..38fff9745c023 100644 --- a/pkgs/applications/gis/qgis/unwrapped-ltr.nix +++ b/pkgs/applications/gis/qgis/unwrapped-ltr.nix @@ -3,7 +3,7 @@ fetchFromGitHub, makeWrapper, mkDerivation, - substituteAll, + replaceVars, wrapGAppsHook3, wrapQtAppsHook, @@ -145,8 +145,7 @@ mkDerivation rec { ++ pythonBuildInputs; patches = [ - (substituteAll { - src = ./set-pyqt-package-dirs-ltr.patch; + (replaceVars ./set-pyqt-package-dirs-ltr.patch { pyQt5PackageDir = "${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}"; qsciPackageDir = "${py.pkgs.qscintilla-qt5}/${py.pkgs.python.sitePackages}"; }) diff --git a/pkgs/applications/gis/qgis/unwrapped.nix b/pkgs/applications/gis/qgis/unwrapped.nix index 484b61b9acdae..4ca9f16c819d1 100644 --- a/pkgs/applications/gis/qgis/unwrapped.nix +++ b/pkgs/applications/gis/qgis/unwrapped.nix @@ -2,7 +2,7 @@ , fetchFromGitHub , makeWrapper , mkDerivation -, substituteAll +, replaceVars , wrapGAppsHook3 , wrapQtAppsHook @@ -141,8 +141,7 @@ in mkDerivation rec { ++ pythonBuildInputs; patches = [ - (substituteAll { - src = ./set-pyqt-package-dirs.patch; + (replaceVars ./set-pyqt-package-dirs.patch { pyQt5PackageDir = "${py.pkgs.pyqt5}/${py.pkgs.python.sitePackages}"; qsciPackageDir = "${py.pkgs.qscintilla-qt5}/${py.pkgs.python.sitePackages}"; }) diff --git a/pkgs/applications/graphics/leocad/default.nix b/pkgs/applications/graphics/leocad/default.nix index 1d9b06f4144bb..5df01fd9052b9 100644 --- a/pkgs/applications/graphics/leocad/default.nix +++ b/pkgs/applications/graphics/leocad/default.nix @@ -6,7 +6,7 @@ povray, qmake, qttools, - substituteAll, + replaceVars, zlib, }: @@ -43,8 +43,7 @@ mkDerivation rec { propagatedBuildInputs = [ povray ]; patches = [ - (substituteAll { - src = ./povray.patch; + (replaceVars ./povray.patch { inherit povray; }) ]; diff --git a/pkgs/applications/graphics/qvge/default.nix b/pkgs/applications/graphics/qvge/default.nix index 1ded1a805ca7e..688f2f0716d66 100644 --- a/pkgs/applications/graphics/qvge/default.nix +++ b/pkgs/applications/graphics/qvge/default.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, wrapQtAppsHook, qmake, qtsvg, @@ -24,8 +24,7 @@ stdenv.mkDerivation rec { sourceRoot = "${src.name}/src"; patches = ( - substituteAll { - src = ./set-graphviz-path.patch; + replaceVars ./set-graphviz-path.patch { inherit graphviz; } ); diff --git a/pkgs/applications/kde/kdenlive/default.nix b/pkgs/applications/kde/kdenlive/default.nix index 95fed3cd35ba9..5aa4c40fef193 100644 --- a/pkgs/applications/kde/kdenlive/default.nix +++ b/pkgs/applications/kde/kdenlive/default.nix @@ -1,6 +1,6 @@ { mkDerivation, - substituteAll, + replaceVars, lib, extra-cmake-modules, breeze-icons, @@ -89,8 +89,7 @@ mkDerivation { # doesn't find them. See: # https://github.com/NixOS/nixpkgs/issues/83885 patches = [ - (substituteAll { - src = ./dependency-paths.patch; + (replaceVars ./dependency-paths.patch { inherit mediainfo glaxnimate; ffmpeg = ffmpeg-full; mlt = mlt-full; diff --git a/pkgs/applications/misc/dmensamenu/default.nix b/pkgs/applications/misc/dmensamenu/default.nix index 7e20001b44a38..447cb0d377940 100644 --- a/pkgs/applications/misc/dmensamenu/default.nix +++ b/pkgs/applications/misc/dmensamenu/default.nix @@ -2,7 +2,7 @@ lib, buildPythonApplication, fetchFromGitHub, - substituteAll, + replaceVars, requests, dmenu, }: @@ -19,8 +19,7 @@ buildPythonApplication rec { }; patches = [ - (substituteAll { - src = ./dmenu-path.patch; + (replaceVars ./dmenu-path.patch { inherit dmenu; }) ]; diff --git a/pkgs/applications/misc/inochi2d/default.nix b/pkgs/applications/misc/inochi2d/default.nix index cb17167d513be..177f3ede6cebc 100644 --- a/pkgs/applications/misc/inochi2d/default.nix +++ b/pkgs/applications/misc/inochi2d/default.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, callPackage, }: @@ -35,8 +35,7 @@ in patches = [ # Upstream asks that we change the bug tracker URL to not point to the upsteam bug tracker - (substituteAll { - src = ./support-url.patch; + (replaceVars ./support-url.patch { assignees = "TomaSajt"; # should be a comma separated list of the github usernames of the maintainers }) # Change how duplicate locales differentiate themselves (the store paths were too long) diff --git a/pkgs/applications/misc/mysql-workbench/default.nix b/pkgs/applications/misc/mysql-workbench/default.nix index a6705904f78f9..bc33c7259c458 100644 --- a/pkgs/applications/misc/mysql-workbench/default.nix +++ b/pkgs/applications/misc/mysql-workbench/default.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchurl, - substituteAll, + replaceVars, cmake, ninja, pkg-config, @@ -57,8 +57,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./hardcode-paths.patch; + (replaceVars ./hardcode-paths.patch { catchsegv = "${glibc.bin}/bin/catchsegv"; bash = "${bash}/bin/bash"; cp = "${coreutils}/bin/cp"; @@ -74,8 +73,7 @@ stdenv.mkDerivation (finalAttrs: { # Fix swig not being able to find headers # https://github.com/NixOS/nixpkgs/pull/82362#issuecomment-597948461 - (substituteAll { - src = ./fix-swig-build.patch; + (replaceVars ./fix-swig-build.patch { cairoDev = "${cairo.dev}"; }) diff --git a/pkgs/applications/networking/irc/weechat/scripts/multiline/default.nix b/pkgs/applications/networking/irc/weechat/scripts/multiline/default.nix index a54078a15299c..94d40da39e7dc 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/multiline/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/multiline/default.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchurl, - substituteAll, + replaceVars, PodParser, }: @@ -22,8 +22,7 @@ stdenv.mkDerivation { patches = [ # The script requires a special Perl environment. - (substituteAll { - src = ./libpath.patch; + (replaceVars ./libpath.patch { env = PodParser; }) ]; diff --git a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix index a21001ab84f2e..0bc1513982aa1 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/wee-slack/default.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchpatch, - substituteAll, + replaceVars, buildEnv, fetchFromGitHub, python3Packages, @@ -20,8 +20,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./libpath.patch; + (replaceVars ./libpath.patch { env = "${ buildEnv { name = "wee-slack-env"; diff --git a/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix b/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix index 717cec1dc3413..e38f415558988 100644 --- a/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix +++ b/pkgs/applications/networking/irc/weechat/scripts/weechat-otr/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, - substituteAll, + replaceVars, buildEnv, fetchgit, fetchFromGitHub, @@ -58,8 +58,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./libpath.patch; + (replaceVars ./libpath.patch { env = "${ buildEnv { name = "weechat-otr-env"; diff --git a/pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix b/pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix index 93a0eb591f9db..7bfb6d45ef0d1 100644 --- a/pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix +++ b/pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix @@ -15,7 +15,7 @@ json-glib, libmspack, webkitgtk_4_1, - substituteAll, + replaceVars, _experimental-update-script-combinators, glib, makeHardcodeGsettingsPatch, @@ -35,8 +35,7 @@ stdenv.mkDerivation rec { # schemas from evolution. evolution-data-server is not wrapped with # evolution's schemas because it would be a circular dependency with # evolution. - (substituteAll { - src = ./hardcode-gsettings.patch; + (replaceVars ./hardcode-gsettings.patch { evo = glib.makeSchemaPath evolution evolution.name; }) ]; diff --git a/pkgs/applications/office/activitywatch/default.nix b/pkgs/applications/office/activitywatch/default.nix index e488363c20128..16cc048d39446 100644 --- a/pkgs/applications/office/activitywatch/default.nix +++ b/pkgs/applications/office/activitywatch/default.nix @@ -15,7 +15,7 @@ qtbase, qtsvg, xdg-utils, - substituteAll, + replaceVars, buildNpmPackage, }: @@ -188,8 +188,7 @@ rec { patches = [ # Override version string with hardcoded value as it may be outdated upstream. - (substituteAll { - src = ./override-version.patch; + (replaceVars ./override-version.patch { version = sources.rev; }) ]; @@ -234,8 +233,7 @@ rec { patches = [ # Hardcode version to avoid the need to have the Git repo available at build time. - (substituteAll { - src = ./commit-hash.patch; + (replaceVars ./commit-hash.patch { commit_hash = sources.rev; }) ]; diff --git a/pkgs/applications/science/math/caffe/default.nix b/pkgs/applications/science/math/caffe/default.nix index 251245469d739..4b9bd9e6fdcc8 100644 --- a/pkgs/applications/science/math/caffe/default.nix +++ b/pkgs/applications/science/math/caffe/default.nix @@ -25,7 +25,7 @@ pythonSupport ? false, python ? null, numpy ? null, - substituteAll, + replaceVars, }: let @@ -130,10 +130,11 @@ stdenv.mkDerivation rec { hash = "sha256-ZegTvp0tTHlopQv+UzHDigs6XLkP2VfqLCWXl6aKJSI="; }) ] - ++ lib.optional pythonSupport (substituteAll { - src = ./python.patch; - inherit (python.sourceVersion) major minor; # Should be changed in case of PyPy - }); + ++ lib.optional pythonSupport ( + replaceVars ./python.patch { + inherit (python.sourceVersion) major minor; # Should be changed in case of PyPy + } + ); postPatch = '' substituteInPlace src/caffe/util/io.cpp --replace \ diff --git a/pkgs/applications/science/misc/cytoscape/default.nix b/pkgs/applications/science/misc/cytoscape/default.nix index 886fb2ef55762..9be37db1b6d00 100644 --- a/pkgs/applications/science/misc/cytoscape/default.nix +++ b/pkgs/applications/science/misc/cytoscape/default.nix @@ -4,7 +4,7 @@ fetchurl, jre, makeWrapper, - substituteAll, + replaceVars, coreutils, }: @@ -20,8 +20,7 @@ stdenv.mkDerivation rec { patches = [ # By default, gen_vmoptions.sh tries to store custom options in $out/share # at run time. This patch makes sure $HOME is used instead. - (substituteAll { - src = ./gen_vmoptions_to_homedir.patch; + (replaceVars ./gen_vmoptions_to_homedir.patch { inherit coreutils; }) ]; diff --git a/pkgs/applications/virtualization/singularity/generic.nix b/pkgs/applications/virtualization/singularity/generic.nix index 6e0b3944fdd2e..08c848feb17c6 100644 --- a/pkgs/applications/virtualization/singularity/generic.nix +++ b/pkgs/applications/virtualization/singularity/generic.nix @@ -25,7 +25,7 @@ in lib, buildGoModule, runCommandLocal, - substituteAll, + replaceVars, # Native build inputs addDriverRunpath, makeWrapper, @@ -109,8 +109,7 @@ in inherit pname version src; patches = lib.optionals (projectName == "apptainer") [ - (substituteAll { - src = ./apptainer/0001-ldCache-patch-for-driverLink.patch; + (replaceVars ./apptainer/0001-ldCache-patch-for-driverLink.patch { inherit (addDriverRunpath) driverLink; }) ]; diff --git a/pkgs/by-name/an/ansible-cmdb/package.nix b/pkgs/by-name/an/ansible-cmdb/package.nix index f23da79053c64..d88ae7ec2f636 100644 --- a/pkgs/by-name/an/ansible-cmdb/package.nix +++ b/pkgs/by-name/an/ansible-cmdb/package.nix @@ -1,7 +1,7 @@ { lib, fetchFromGitHub, - substituteAll, + replaceVars, python3Packages, testers, ansible-cmdb, @@ -31,8 +31,7 @@ buildPythonApplication { }; patches = [ - (substituteAll { - src = ./setup.patch; + (replaceVars ./setup.patch { inherit version; }) ]; diff --git a/pkgs/by-name/ar/argyllcms/package.nix b/pkgs/by-name/ar/argyllcms/package.nix index 139caabe2cda9..f430676270222 100644 --- a/pkgs/by-name/ar/argyllcms/package.nix +++ b/pkgs/by-name/ar/argyllcms/package.nix @@ -19,7 +19,7 @@ lib, openssl, buildPackages, - substituteAll, + replaceVars, writeScript, }: @@ -41,8 +41,7 @@ stdenv.mkDerivation rec { patches = lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ( # Build process generates files by compiling and then invoking an executable. - substituteAll { - src = ./jam-cross.patch; + replaceVars ./jam-cross.patch { emulator = stdenv.hostPlatform.emulator buildPackages; } ); diff --git a/pkgs/by-name/au/auto-cpufreq/package.nix b/pkgs/by-name/au/auto-cpufreq/package.nix index 15db7faa4089b..fe9e2ca49ae82 100644 --- a/pkgs/by-name/au/auto-cpufreq/package.nix +++ b/pkgs/by-name/au/auto-cpufreq/package.nix @@ -2,7 +2,7 @@ lib, python3Packages, fetchFromGitHub, - substituteAll, + replaceVars, gobject-introspection, wrapGAppsHook3, gtk3, @@ -48,8 +48,7 @@ python3Packages.buildPythonPackage rec { patches = [ # hardcodes version output - (substituteAll { - src = ./fix-version-output.patch; + (replaceVars ./fix-version-output.patch { inherit version; }) diff --git a/pkgs/by-name/ba/bashblog/package.nix b/pkgs/by-name/ba/bashblog/package.nix index 91a34e9b3e70b..3647eb90e9500 100644 --- a/pkgs/by-name/ba/bashblog/package.nix +++ b/pkgs/by-name/ba/bashblog/package.nix @@ -3,7 +3,7 @@ lib, fetchFromGitHub, makeWrapper, - substituteAll, + replaceVars, perlPackages, # Flags to enable processors # Currently, Markdown.pl does not work @@ -35,8 +35,7 @@ stdenv.mkDerivation { buildInputs = [ TextMarkdown ] ++ lib.optionals usePandoc [ pandoc ]; patches = [ - (substituteAll { - src = ./0001-Setting-markdown_bin.patch; + (replaceVars ./0001-Setting-markdown_bin.patch { markdown_path = if usePandoc then pandoc_path else markdownpl_path; }) ]; diff --git a/pkgs/by-name/bc/bcache-tools/package.nix b/pkgs/by-name/bc/bcache-tools/package.nix index 795e453e1b4e5..c070b5c10c943 100644 --- a/pkgs/by-name/bc/bcache-tools/package.nix +++ b/pkgs/by-name/bc/bcache-tools/package.nix @@ -5,7 +5,7 @@ pkg-config, util-linux, bash, - substituteAll, + replaceVars, }: stdenv.mkDerivation rec { @@ -34,8 +34,7 @@ stdenv.mkDerivation rec { ''; patches = [ - (substituteAll { - src = ./bcache-udev-modern.patch; + (replaceVars ./bcache-udev-modern.patch { shell = "${bash}/bin/sh"; }) ./fix-static.patch diff --git a/pkgs/by-name/bo/bonnmotion/package.nix b/pkgs/by-name/bo/bonnmotion/package.nix index 502cd8c70d693..28011069f553e 100644 --- a/pkgs/by-name/bo/bonnmotion/package.nix +++ b/pkgs/by-name/bo/bonnmotion/package.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchzip, - substituteAll, + replaceVars, bash, jre, }: @@ -20,8 +20,7 @@ stdenv.mkDerivation rec { # The software has a non-standard install bash script which kind of works. # However, to make it fully functional, the automatically detection of the # program paths must be substituted with full paths. - (substituteAll { - src = ./install.patch; + (replaceVars ./install.patch { inherit bash jre; }) ]; diff --git a/pkgs/by-name/bu/budgie-session/package.nix b/pkgs/by-name/bu/budgie-session/package.nix index 407902d824e70..7170bf16474cf 100644 --- a/pkgs/by-name/bu/budgie-session/package.nix +++ b/pkgs/by-name/bu/budgie-session/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, meson, ninja, pkg-config, @@ -46,8 +46,7 @@ stdenv.mkDerivation (finalAttrs: { ]; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { gsettings = lib.getExe' glib "gsettings"; dbusLaunch = lib.getExe' dbus "dbus-launch"; bash = lib.getExe bash; diff --git a/pkgs/by-name/ca/cargo-benchcmp/package.nix b/pkgs/by-name/ca/cargo-benchcmp/package.nix index cbb86ed458e63..d889310df580a 100644 --- a/pkgs/by-name/ca/cargo-benchcmp/package.nix +++ b/pkgs/by-name/ca/cargo-benchcmp/package.nix @@ -2,7 +2,7 @@ lib, rustPlatform, fetchFromGitHub, - substituteAll, + replaceVars, stdenv, }: @@ -21,8 +21,7 @@ rustPlatform.buildRustPackage rec { patches = [ # patch the binary path so tests can find the binary when `--target` is present - (substituteAll { - src = ./fix-test-binary-path.patch; + (replaceVars ./fix-test-binary-path.patch { shortTarget = stdenv.hostPlatform.rust.rustcTarget; }) ]; diff --git a/pkgs/by-name/ch/chawan/package.nix b/pkgs/by-name/ch/chawan/package.nix index 35808fae23882..77abe682cf8ba 100644 --- a/pkgs/by-name/ch/chawan/package.nix +++ b/pkgs/by-name/ch/chawan/package.nix @@ -11,7 +11,7 @@ , zlib , unstableGitUpdater , libseccomp -, substituteAll +, replaceVars }: stdenv.mkDerivation { @@ -28,8 +28,7 @@ stdenv.mkDerivation { patches = [ # Include chawan's man pages in mancha's search path - (substituteAll { - src = ./mancha-augment-path.diff; + (replaceVars ./mancha-augment-path.diff { out = placeholder "out"; }) ]; diff --git a/pkgs/by-name/cj/cjdns/package.nix b/pkgs/by-name/cj/cjdns/package.nix index 9d4bd485c7994..b08ab4d6bb857 100644 --- a/pkgs/by-name/cj/cjdns/package.nix +++ b/pkgs/by-name/cj/cjdns/package.nix @@ -11,7 +11,7 @@ nixosTests, libsodium, pkg-config, - substituteAll, + replaceVars, }: rustPlatform.buildRustPackage rec { @@ -26,8 +26,7 @@ rustPlatform.buildRustPackage rec { }; patches = [ - (substituteAll { - src = ./system-libsodium.patch; + (replaceVars ./system-libsodium.patch { libsodium_include_dir = "${libsodium.dev}/include"; }) ]; diff --git a/pkgs/by-name/co/cosmopolitan/package.nix b/pkgs/by-name/co/cosmopolitan/package.nix index f38c2778ba4e6..fd8821dd8a1a7 100644 --- a/pkgs/by-name/co/cosmopolitan/package.nix +++ b/pkgs/by-name/co/cosmopolitan/package.nix @@ -5,7 +5,7 @@ bintools-unwrapped, callPackage, coreutils, - substituteAll, + replaceVars, unzip, }: @@ -22,8 +22,7 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # make sure tests set PATH correctly - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit coreutils; }) ]; diff --git a/pkgs/by-name/cu/curseradio/package.nix b/pkgs/by-name/cu/curseradio/package.nix index ef38287b2d328..431d600830ca7 100644 --- a/pkgs/by-name/cu/curseradio/package.nix +++ b/pkgs/by-name/cu/curseradio/package.nix @@ -1,7 +1,7 @@ { lib, fetchFromGitHub, - substituteAll, + replaceVars, python3Packages, mpv, }: @@ -24,8 +24,7 @@ python3Packages.buildPythonApplication rec { ]; patches = [ - (substituteAll { - src = ./mpv.patch; + (replaceVars ./mpv.patch { inherit mpv; }) ]; diff --git a/pkgs/by-name/da/davfs2/package.nix b/pkgs/by-name/da/davfs2/package.nix index 529d963af3041..606659c0f4674 100644 --- a/pkgs/by-name/da/davfs2/package.nix +++ b/pkgs/by-name/da/davfs2/package.nix @@ -3,7 +3,7 @@ , autoreconfHook , neon , procps -, substituteAll +, replaceVars , zlib , wrapperDir ? "/run/wrappers/bin" }: @@ -28,12 +28,10 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./fix-sysconfdir.patch ./disable-suid.patch - (substituteAll { - src = ./0001-umount_davfs-substitute-ps-command.patch; + (replaceVars ./0001-umount_davfs-substitute-ps-command.patch { ps = "${procps}/bin/ps"; }) - (substituteAll { - src = ./0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch; + (replaceVars ./0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch { inherit wrapperDir; }) ]; diff --git a/pkgs/by-name/dc/dcm2niix/package.nix b/pkgs/by-name/dc/dcm2niix/package.nix index 5d73f8d5b4603..58f46098e6a0d 100644 --- a/pkgs/by-name/dc/dcm2niix/package.nix +++ b/pkgs/by-name/dc/dcm2niix/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, cmake, openjpeg, yaml-cpp, @@ -34,8 +34,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = lib.optionals withCloudflareZlib [ - (substituteAll { - src = ./dont-fetch-external-libs.patch; + (replaceVars ./dont-fetch-external-libs.patch { inherit cloudflareZlib; }) ]; diff --git a/pkgs/by-name/de/deja-dup/package.nix b/pkgs/by-name/de/deja-dup/package.nix index 274920e92d1a9..607b4ec144f8f 100644 --- a/pkgs/by-name/de/deja-dup/package.nix +++ b/pkgs/by-name/de/deja-dup/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitLab, - substituteAll, + replaceVars, meson, ninja, pkg-config, @@ -36,8 +36,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit coreutils; }) ]; diff --git a/pkgs/by-name/el/elvish/tests/expect-version.nix b/pkgs/by-name/el/elvish/tests/expect-version.nix index 123b94e3cbd02..ee9b8ed3969ca 100644 --- a/pkgs/by-name/el/elvish/tests/expect-version.nix +++ b/pkgs/by-name/el/elvish/tests/expect-version.nix @@ -1,7 +1,7 @@ { stdenv, elvish, - substituteAll, + replaceVars, }: stdenv.mkDerivation { @@ -14,8 +14,7 @@ stdenv.mkDerivation { buildCommand = '' elvish ${ - substituteAll { - src = ./expect-version.elv; + replaceVars ./expect-version.elv { inherit (elvish) version; } } diff --git a/pkgs/by-name/eq/equibop/package.nix b/pkgs/by-name/eq/equibop/package.nix index dffa1bab8f712..f6105d9f7f6ea 100644 --- a/pkgs/by-name/eq/equibop/package.nix +++ b/pkgs/by-name/eq/equibop/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, makeWrapper, makeDesktopItem, copyDesktopItems, @@ -64,10 +64,11 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./disable_update_checking.patch ] - ++ lib.optional withSystemEquicord (substituteAll { - inherit equicord; - src = ./use_system_equicord.patch; - }); + ++ lib.optional withSystemEquicord ( + replaceVars ./use_system_equicord.patch { + inherit equicord; + } + ); env = { ELECTRON_SKIP_BINARY_DOWNLOAD = 1; diff --git a/pkgs/by-name/fe/febio/package.nix b/pkgs/by-name/fe/febio/package.nix index 96657c506c0f1..698b0d81ea803 100644 --- a/pkgs/by-name/fe/febio/package.nix +++ b/pkgs/by-name/fe/febio/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitHub, fetchpatch2, - substituteAll, + replaceVars, apple-sdk_11, cmake, darwinMinVersionHook, @@ -26,8 +26,7 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Fix library searching and installation - (substituteAll { - src = ./fix-cmake.patch; + (replaceVars ./fix-cmake.patch { so = stdenv.hostPlatform.extensions.sharedLibrary; }) diff --git a/pkgs/by-name/fl/flottbot/package.nix b/pkgs/by-name/fl/flottbot/package.nix index 0242d8f144823..3257c2a421acb 100644 --- a/pkgs/by-name/fl/flottbot/package.nix +++ b/pkgs/by-name/fl/flottbot/package.nix @@ -3,7 +3,7 @@ buildGoModule, fetchFromGitHub, nix-update-script, - substituteAll, + replaceVars, }: buildGoModule rec { pname = "flottbot"; @@ -18,8 +18,7 @@ buildGoModule rec { patches = [ # patch out debug.ReadBuidlInfo since version information is not available with buildGoModule - (substituteAll { - src = ./version.patch; + (replaceVars ./version.patch { version = version; vcsHash = version; # Maybe there is a way to get the git ref from src? idk. }) diff --git a/pkgs/by-name/fx/fxlinuxprintutil/package.nix b/pkgs/by-name/fx/fxlinuxprintutil/package.nix index 7d3ddd08ac6e8..f95b39c153e50 100644 --- a/pkgs/by-name/fx/fxlinuxprintutil/package.nix +++ b/pkgs/by-name/fx/fxlinuxprintutil/package.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchzip, - substituteAll, + replaceVars, dpkg, autoPatchelfHook, cups, @@ -41,8 +41,7 @@ stdenv.mkDerivation rec { # replaces the code that looks for X11’s locale.alias in /usr/share/X11/locale or # /usr/lib/X11/locale with /nix/store/libX11/share/X11/locale - (substituteAll { - src = ./fxlocalechk.tcl.patch; + (replaceVars ./fxlocalechk.tcl.patch { inherit (xorg) libX11; }) ]; diff --git a/pkgs/by-name/ga/gammu/package.nix b/pkgs/by-name/ga/gammu/package.nix index 95e28f821cd97..2ee0061850b96 100644 --- a/pkgs/by-name/ga/gammu/package.nix +++ b/pkgs/by-name/ga/gammu/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, pkg-config, cmake, bluez, @@ -34,8 +34,7 @@ stdenv.mkDerivation rec { patches = [ ./bashcomp-dir.patch ./systemd.patch - (substituteAll { - src = ./gammu-config-dialog.patch; + (replaceVars ./gammu-config-dialog.patch { dialog = "${dialog}/bin/dialog"; }) ]; diff --git a/pkgs/by-name/gl/glycin-loaders/package.nix b/pkgs/by-name/gl/glycin-loaders/package.nix index 76a9800952c68..6977f71a8b554 100644 --- a/pkgs/by-name/gl/glycin-loaders/package.nix +++ b/pkgs/by-name/gl/glycin-loaders/package.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchurl, - substituteAll, + replaceVars, bubblewrap, cairo, cargo, @@ -70,8 +70,7 @@ stdenv.mkDerivation (finalAttrs: { packageName = "glycin"; }; - glycinPathsPatch = substituteAll { - src = ./fix-glycin-paths.patch; + glycinPathsPatch = replaceVars ./fix-glycin-paths.patch { bwrap = "${bubblewrap}/bin/bwrap"; }; }; diff --git a/pkgs/by-name/go/govulncheck/package.nix b/pkgs/by-name/go/govulncheck/package.nix index a7d0b88eca40a..b5cd36afea4b4 100644 --- a/pkgs/by-name/go/govulncheck/package.nix +++ b/pkgs/by-name/go/govulncheck/package.nix @@ -2,7 +2,7 @@ lib, buildGoModule, fetchFromGitHub, - substituteAll, + replaceVars, }: buildGoModule rec { @@ -18,8 +18,7 @@ buildGoModule rec { patches = [ # patch in version information - (substituteAll { - src = ./version.patch; + (replaceVars ./version.patch { inherit version; }) ]; diff --git a/pkgs/by-name/gr/grilo-plugins/package.nix b/pkgs/by-name/gr/grilo-plugins/package.nix index d2837d186a052..873886d950410 100644 --- a/pkgs/by-name/gr/grilo-plugins/package.nix +++ b/pkgs/by-name/gr/grilo-plugins/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchurl, - substituteAll, + replaceVars, meson, ninja, pkg-config, @@ -45,8 +45,7 @@ stdenv.mkDerivation rec { # * fakesink (gstreamer) # * playbin (gst-plugins-base) # * chromaprint (gst-plugins-bad) - (substituteAll { - src = ./chromaprint-gst-plugins.patch; + (replaceVars ./chromaprint-gst-plugins.patch { load_plugins = lib.concatMapStrings (plugin: ''gst_registry_scan_path(gst_registry_get(), "${lib.getLib plugin}/lib/gstreamer-1.0");'') diff --git a/pkgs/by-name/hp/hplip/package.nix b/pkgs/by-name/hp/hplip/package.nix index d5d7e1cc99b30..e1b96e2f233bd 100644 --- a/pkgs/by-name/hp/hplip/package.nix +++ b/pkgs/by-name/hp/hplip/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchurl, - substituteAll, + replaceVars, pkg-config, autoreconfHook, gobject-introspection, @@ -47,9 +47,8 @@ let hash = "sha256-Hzxr3SVmGoouGBU2VdbwbwKMHZwwjWnI7P13Z6LQxao="; }; - hplipState = substituteAll { + hplipState = replaceVars ./hplip.state { inherit version; - src = ./hplip.state; }; hplipPlatforms = { diff --git a/pkgs/by-name/hy/hypnotix/package.nix b/pkgs/by-name/hy/hypnotix/package.nix index a9f8c306bf4a2..67e04b4e8ddb7 100644 --- a/pkgs/by-name/hy/hypnotix/package.nix +++ b/pkgs/by-name/hy/hypnotix/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, xapp, circle-flags, gettext, @@ -25,8 +25,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./libmpv-path.patch; + (replaceVars ./libmpv-path.patch { libmpv = "${lib.getLib mpv}/lib/libmpv${stdenv.hostPlatform.extensions.sharedLibrary}"; }) ]; diff --git a/pkgs/by-name/ka/kazam/package.nix b/pkgs/by-name/ka/kazam/package.nix index f887b39f2d2e3..ad4c7a7dcc4d1 100644 --- a/pkgs/by-name/ka/kazam/package.nix +++ b/pkgs/by-name/ka/kazam/package.nix @@ -1,7 +1,7 @@ { lib, fetchFromGitHub, - substituteAll, + replaceVars, python3Packages, gst_all_1, wrapGAppsHook3, @@ -54,8 +54,7 @@ python3Packages.buildPythonApplication rec { patches = [ # Fix paths - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { libcanberra = libcanberra-gtk3; inherit libpulseaudio; }) diff --git a/pkgs/by-name/li/libelfin/package.nix b/pkgs/by-name/li/libelfin/package.nix index 663b5c3dd7f0f..a76808dede96e 100644 --- a/pkgs/by-name/li/libelfin/package.nix +++ b/pkgs/by-name/li/libelfin/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitHub, python3, - substituteAll, + replaceVars, }: stdenv.mkDerivation rec { @@ -18,8 +18,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./0001-Don-t-detect-package-version-with-Git.patch; + (replaceVars ./0001-Don-t-detect-package-version-with-Git.patch { inherit version; }) ]; diff --git a/pkgs/by-name/li/libpam-wrapper/package.nix b/pkgs/by-name/li/libpam-wrapper/package.nix index 6ea6229f4ddac..0dba2ed325392 100644 --- a/pkgs/by-name/li/libpam-wrapper/package.nix +++ b/pkgs/by-name/li/libpam-wrapper/package.nix @@ -4,7 +4,7 @@ fetchgit, cmake, linux-pam, - substituteAll, + replaceVars, enablePython ? false, python ? null, }: @@ -22,8 +22,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./python.patch; + (replaceVars ./python.patch { siteDir = lib.optionalString enablePython python.sitePackages; includeDir = lib.optionalString enablePython "include/${python.libPrefix}"; }) diff --git a/pkgs/by-name/li/librum/package.nix b/pkgs/by-name/li/librum/package.nix index 5e2844ed73cb0..821c9da8396a0 100644 --- a/pkgs/by-name/li/librum/package.nix +++ b/pkgs/by-name/li/librum/package.nix @@ -3,7 +3,7 @@ mupdf, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, cmake, qt6, desktopToDarwinBundle, @@ -25,8 +25,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./use_mupdf_in_nixpkgs.patch; + (replaceVars ./use_mupdf_in_nixpkgs.patch { nixMupdfLibPath = "${mupdf-cxx.out}/lib"; nixMupdfIncludePath = "${mupdf-cxx.dev}/include"; }) diff --git a/pkgs/by-name/li/libvpl/package.nix b/pkgs/by-name/li/libvpl/package.nix index 61b4d79b8cfc6..695f7ab3d49f8 100644 --- a/pkgs/by-name/li/libvpl/package.nix +++ b/pkgs/by-name/li/libvpl/package.nix @@ -4,7 +4,7 @@ fetchFromGitHub, cmake, pkg-config, - substituteAll, + replaceVars, addDriverRunpath, }: @@ -29,8 +29,7 @@ stdenv.mkDerivation (finalAttrs: { ]; patches = [ - (substituteAll { - src = ./opengl-driver-lib.patch; + (replaceVars ./opengl-driver-lib.patch { inherit (addDriverRunpath) driverLink; }) ]; diff --git a/pkgs/by-name/li/likwid/package.nix b/pkgs/by-name/li/likwid/package.nix index 8a8a492fa0f46..2740133001162 100644 --- a/pkgs/by-name/li/likwid/package.nix +++ b/pkgs/by-name/li/likwid/package.nix @@ -2,7 +2,7 @@ , stdenv , fetchurl , perl -, substituteAll +, replaceVars , coreutils , gnugrep }: @@ -22,8 +22,7 @@ stdenv.mkDerivation rec { patches = [ ./nosetuid.patch - (substituteAll { - src = ./cat-grep-sort-wc.patch; + (replaceVars ./cat-grep-sort-wc.patch { coreutils = "${coreutils}/bin/"; gnugrep = "${gnugrep}/bin/"; }) diff --git a/pkgs/by-name/lu/luaformatter/package.nix b/pkgs/by-name/lu/luaformatter/package.nix index eedf1868adb64..ca98f83dc7348 100644 --- a/pkgs/by-name/lu/luaformatter/package.nix +++ b/pkgs/by-name/lu/luaformatter/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, antlr4_9, libargs, catch2, @@ -24,8 +24,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-lib-paths.patch; + (replaceVars ./fix-lib-paths.patch { antlr4RuntimeCpp = antlr4.runtime.cpp.dev; yamlCpp = yaml-cpp; inherit libargs catch2; diff --git a/pkgs/by-name/ne/networkmanager-fortisslvpn/package.nix b/pkgs/by-name/ne/networkmanager-fortisslvpn/package.nix index 7e927c650cdd6..c7bd34d4ee4ee 100644 --- a/pkgs/by-name/ne/networkmanager-fortisslvpn/package.nix +++ b/pkgs/by-name/ne/networkmanager-fortisslvpn/package.nix @@ -1,7 +1,7 @@ { stdenv , lib , fetchurl -, substituteAll +, replaceVars , openfortivpn , autoreconfHook , gettext @@ -30,8 +30,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit openfortivpn; }) ./support-ppp-2.5.0.patch diff --git a/pkgs/by-name/ne/networkmanager-iodine/package.nix b/pkgs/by-name/ne/networkmanager-iodine/package.nix index c1fea9dcb77d8..c26a0ddfe9a91 100644 --- a/pkgs/by-name/ne/networkmanager-iodine/package.nix +++ b/pkgs/by-name/ne/networkmanager-iodine/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitLab, - substituteAll, + replaceVars, autoreconfHook, iodine, intltool, @@ -29,8 +29,7 @@ stdenv.mkDerivation { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit iodine; }) ]; diff --git a/pkgs/by-name/ne/networkmanager-l2tp/package.nix b/pkgs/by-name/ne/networkmanager-l2tp/package.nix index d44ae6a320905..f0b9698fa65e8 100644 --- a/pkgs/by-name/ne/networkmanager-l2tp/package.nix +++ b/pkgs/by-name/ne/networkmanager-l2tp/package.nix @@ -1,7 +1,7 @@ { stdenv, lib, - substituteAll, + replaceVars, fetchFromGitHub, autoreconfHook, pkg-config, @@ -33,8 +33,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit strongswan xl2tpd; }) ]; diff --git a/pkgs/by-name/ne/networkmanager-openconnect/package.nix b/pkgs/by-name/ne/networkmanager-openconnect/package.nix index 0e2a199d5c3a1..c33ba6644f90f 100644 --- a/pkgs/by-name/ne/networkmanager-openconnect/package.nix +++ b/pkgs/by-name/ne/networkmanager-openconnect/package.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchurl, - substituteAll, + replaceVars, glib, libxml2, openconnect, @@ -32,8 +32,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit kmod openconnect; }) ]; diff --git a/pkgs/by-name/ne/networkmanager-openvpn/package.nix b/pkgs/by-name/ne/networkmanager-openvpn/package.nix index a7d7aa0732a0e..964a51ddab971 100644 --- a/pkgs/by-name/ne/networkmanager-openvpn/package.nix +++ b/pkgs/by-name/ne/networkmanager-openvpn/package.nix @@ -2,7 +2,7 @@ stdenv, lib, fetchurl, - substituteAll, + replaceVars, openvpn, gettext, libxml2, @@ -30,8 +30,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit kmod openvpn; }) ]; diff --git a/pkgs/by-name/ne/networkmanager-vpnc/package.nix b/pkgs/by-name/ne/networkmanager-vpnc/package.nix index aa88991517530..52f47d871199c 100644 --- a/pkgs/by-name/ne/networkmanager-vpnc/package.nix +++ b/pkgs/by-name/ne/networkmanager-vpnc/package.nix @@ -1,7 +1,7 @@ { stdenv , lib , fetchurl -, substituteAll +, replaceVars , vpnc , pkg-config , networkmanager @@ -27,8 +27,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit vpnc kmod; }) ]; diff --git a/pkgs/by-name/ni/nitter/package.nix b/pkgs/by-name/ni/nitter/package.nix index 0ff628f39416e..d03f1e0064137 100644 --- a/pkgs/by-name/ni/nitter/package.nix +++ b/pkgs/by-name/ni/nitter/package.nix @@ -3,7 +3,7 @@ buildNimPackage, fetchFromGitHub, nixosTests, - substituteAll, + replaceVars, unstableGitUpdater, }: @@ -22,8 +22,7 @@ buildNimPackage ( lockFile = ./lock.json; patches = [ - (substituteAll { - src = ./nitter-version.patch; + (replaceVars ./nitter-version.patch { inherit (finalAttrs) version; inherit (finalAttrs.src) rev; url = builtins.replaceStrings [ "archive" ".tar.gz" ] [ "commit" "" ] finalAttrs.src.url; diff --git a/pkgs/by-name/no/novnc/package.nix b/pkgs/by-name/no/novnc/package.nix index cf5bf023ad908..d46b03f8080a5 100644 --- a/pkgs/by-name/no/novnc/package.nix +++ b/pkgs/by-name/no/novnc/package.nix @@ -2,7 +2,7 @@ lib, python3, stdenv, - substituteAll, + replaceVars, fetchFromGitHub, }: @@ -20,8 +20,7 @@ stdenv.mkDerivation rec { patches = with python3.pkgs; [ - (substituteAll { - src = ./websockify.patch; + (replaceVars ./websockify.patch { inherit websockify; }) ] diff --git a/pkgs/by-name/on/onionshare-gui/package.nix b/pkgs/by-name/on/onionshare-gui/package.nix index 85c3527522b0b..7ec4761844a6c 100644 --- a/pkgs/by-name/on/onionshare-gui/package.nix +++ b/pkgs/by-name/on/onionshare-gui/package.nix @@ -1,7 +1,7 @@ { python3Packages, onionshare, - substituteAll, + replaceVars, meek, obfs4, snowflake, @@ -23,8 +23,7 @@ python3Packages.buildPythonApplication rec { patches = [ # hardcode store paths of dependencies - (substituteAll { - src = ./fix-paths-gui.patch; + (replaceVars ./fix-paths-gui.patch { inherit meek obfs4 diff --git a/pkgs/by-name/on/onionshare/package.nix b/pkgs/by-name/on/onionshare/package.nix index 4b36c4ca5f011..463bc38e02246 100644 --- a/pkgs/by-name/on/onionshare/package.nix +++ b/pkgs/by-name/on/onionshare/package.nix @@ -5,7 +5,7 @@ fetchFromGitHub, # patches - substituteAll, + replaceVars, meek, obfs4, snowflake, @@ -32,8 +32,7 @@ python3Packages.buildPythonApplication rec { patches = [ # hardcode store paths of dependencies - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { inherit meek obfs4 diff --git a/pkgs/by-name/or/org-stats/package.nix b/pkgs/by-name/or/org-stats/package.nix index f5699e2728d30..297c76095bfa7 100644 --- a/pkgs/by-name/or/org-stats/package.nix +++ b/pkgs/by-name/or/org-stats/package.nix @@ -2,7 +2,7 @@ lib, buildGoModule, fetchFromGitHub, - substituteAll, + replaceVars, installShellFiles, testers, org-stats, @@ -24,8 +24,7 @@ buildGoModule rec { patches = [ # patch in version information # since `debug.ReadBuildInfo` does not work with `go build - (substituteAll { - src = ./version.patch; + (replaceVars ./version.patch { inherit version; }) ]; diff --git a/pkgs/by-name/pa/passage/package.nix b/pkgs/by-name/pa/passage/package.nix index ac1b68a9d9837..42c44cea979a8 100644 --- a/pkgs/by-name/pa/passage/package.nix +++ b/pkgs/by-name/pa/passage/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitHub, makeBinaryWrapper, - substituteAll, + replaceVars, age, getopt, coreutils, @@ -31,8 +31,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./darwin-getopt-path.patch; + (replaceVars ./darwin-getopt-path.patch { inherit getopt; }) ]; diff --git a/pkgs/by-name/pi/pika-backup/package.nix b/pkgs/by-name/pi/pika-backup/package.nix index 41644b5dcee77..c12fa42c692b7 100644 --- a/pkgs/by-name/pi/pika-backup/package.nix +++ b/pkgs/by-name/pi/pika-backup/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitLab, rustPlatform, - substituteAll, + replaceVars, cargo, desktop-file-utils, git, @@ -39,8 +39,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./borg-path.patch; + (replaceVars ./borg-path.patch { borg = lib.getExe borgbackup; }) ]; diff --git a/pkgs/by-name/r1/r128gain/package.nix b/pkgs/by-name/r1/r128gain/package.nix index e63664594568a..63b7d312d5bd8 100644 --- a/pkgs/by-name/r1/r128gain/package.nix +++ b/pkgs/by-name/r1/r128gain/package.nix @@ -2,7 +2,7 @@ lib, fetchFromGitHub, gitUpdater, - substituteAll, + replaceVars, ffmpeg, python3Packages, sox, @@ -20,8 +20,7 @@ python3Packages.buildPythonApplication rec { }; patches = [ - (substituteAll { - src = ./ffmpeg-location.patch; + (replaceVars ./ffmpeg-location.patch { inherit ffmpeg; }) ]; diff --git a/pkgs/by-name/rt/rtfm/package.nix b/pkgs/by-name/rt/rtfm/package.nix index d097bf8f24994..3bf066ff18f0e 100644 --- a/pkgs/by-name/rt/rtfm/package.nix +++ b/pkgs/by-name/rt/rtfm/package.nix @@ -11,7 +11,7 @@ libadwaita, gtk4, pango, - substituteAll, + replaceVars, }: let gtk4' = gtk4.override { x11Support = true; }; @@ -33,8 +33,7 @@ crystal.buildCrystalPackage rec { # 1) fixed gi-crystal binding generator command # 2) fixed docset generator command # 3) added commands to build gschemas and update icon-cache - (substituteAll { - src = ./make.patch; + (replaceVars ./make.patch { inherit crystal; }) # added chmod +w for copied docs to prevent error: diff --git a/pkgs/by-name/sc/scanservjs/package.nix b/pkgs/by-name/sc/scanservjs/package.nix index ccacd814a569a..e320392d2f7f4 100644 --- a/pkgs/by-name/sc/scanservjs/package.nix +++ b/pkgs/by-name/sc/scanservjs/package.nix @@ -4,7 +4,7 @@ buildNpmPackage, fetchNpmDeps, nodejs, - substituteAll, + replaceVars, }: let @@ -66,8 +66,7 @@ buildNpmPackage { preBuild = '' chmod +w /build/source patch -p3 <${ - substituteAll { - src = ./decouple-from-source-tree.patch; + replaceVars ./decouple-from-source-tree.patch { inherit client; } } diff --git a/pkgs/by-name/sh/shotcut/package.nix b/pkgs/by-name/sh/shotcut/package.nix index a3746c8edc1fd..a33b5a6b323ab 100644 --- a/pkgs/by-name/sh/shotcut/package.nix +++ b/pkgs/by-name/sh/shotcut/package.nix @@ -2,7 +2,7 @@ lib, fetchFromGitHub, stdenv, - substituteAll, + replaceVars, SDL2, frei0r, ladspaPlugins, @@ -53,9 +53,8 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DSHOTCUT_VERSION=${finalAttrs.version}" ]; patches = [ - (substituteAll { + (replaceVars ./fix-mlt-ffmpeg-path.patch { inherit mlt ffmpeg; - src = ./fix-mlt-ffmpeg-path.patch; }) ]; diff --git a/pkgs/by-name/si/sing-geosite/package.nix b/pkgs/by-name/si/sing-geosite/package.nix index cedbdf3cd4900..f8be5c3357c1c 100644 --- a/pkgs/by-name/si/sing-geosite/package.nix +++ b/pkgs/by-name/si/sing-geosite/package.nix @@ -2,13 +2,12 @@ lib, buildGoModule, fetchFromGitHub, - substituteAll, + replaceVars, v2ray-domain-list-community, }: let - patch = substituteAll { - src = ./main.go; + patch = replaceVars ./main.go { geosite_data = "${v2ray-domain-list-community}/share/v2ray/geosite.dat"; }; in diff --git a/pkgs/by-name/si/siyuan/package.nix b/pkgs/by-name/si/siyuan/package.nix index 544de347498c1..154545960f56a 100644 --- a/pkgs/by-name/si/siyuan/package.nix +++ b/pkgs/by-name/si/siyuan/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitHub, buildGo123Module, - substituteAll, + replaceVars, pandoc, nodejs, pnpm_9, @@ -51,8 +51,7 @@ stdenv.mkDerivation (finalAttrs: { vendorHash = "sha256-uK++FoWCoeb05TyUhh0PK+wkTmzTko0K7oLodoGAWt8="; patches = [ - (substituteAll { - src = ./set-pandoc-path.patch; + (replaceVars ./set-pandoc-path.patch { pandoc_path = lib.getExe pandoc; }) ]; diff --git a/pkgs/by-name/st/static-server/package.nix b/pkgs/by-name/st/static-server/package.nix index 443d6b9c71704..57527d9e3c2c5 100644 --- a/pkgs/by-name/st/static-server/package.nix +++ b/pkgs/by-name/st/static-server/package.nix @@ -6,7 +6,7 @@ stdenv, testers, static-server, - substituteAll, + replaceVars, }: buildGoModule rec { @@ -24,8 +24,7 @@ buildGoModule rec { patches = [ # patch out debug.ReadBuidlInfo since version information is not available with buildGoModule - (substituteAll { - src = ./version.patch; + (replaceVars ./version.patch { inherit version; }) ]; diff --git a/pkgs/by-name/st/stumpish/package.nix b/pkgs/by-name/st/stumpish/package.nix index a7bfd38c07a86..519d02ea597ac 100644 --- a/pkgs/by-name/st/stumpish/package.nix +++ b/pkgs/by-name/st/stumpish/package.nix @@ -1,7 +1,7 @@ { lib, stdenv, - substituteAll, + replaceVars, fetchFromGitHub, gnused, ncurses, @@ -28,8 +28,7 @@ stdenv.mkDerivation { ]; patches = [ - (substituteAll { - src = ./paths.patch; + (replaceVars ./paths.patch { sed = "${gnused}/bin/sed"; xprop = "${xorg.xprop}/bin/xprop"; rlwrap = "${rlwrap}/bin/rlwrap"; diff --git a/pkgs/by-name/te/teavpn2/package.nix b/pkgs/by-name/te/teavpn2/package.nix index 7b2e3060d2886..98c35cc2fcbac 100644 --- a/pkgs/by-name/te/teavpn2/package.nix +++ b/pkgs/by-name/te/teavpn2/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, iproute2, }: stdenv.mkDerivation { @@ -17,8 +17,7 @@ stdenv.mkDerivation { }; patches = [ - (substituteAll { - src = ./nix.patch; + (replaceVars ./nix.patch { inherit iproute2; }) ]; diff --git a/pkgs/by-name/ty/typescript-language-server/package.nix b/pkgs/by-name/ty/typescript-language-server/package.nix index 29265f3931a1f..480abfd9ff531 100644 --- a/pkgs/by-name/ty/typescript-language-server/package.nix +++ b/pkgs/by-name/ty/typescript-language-server/package.nix @@ -7,7 +7,7 @@ makeWrapper, nodejs, prefetch-yarn-deps, - substituteAll, + replaceVars, yarn, testers, typescript, @@ -25,8 +25,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./default-fallbackTsserverPath.diff; + (replaceVars ./default-fallbackTsserverPath.diff { typescript = "${typescript}/lib/node_modules/typescript/lib/tsserver.js"; }) ]; diff --git a/pkgs/by-name/vd/vdhcoapp/package.nix b/pkgs/by-name/vd/vdhcoapp/package.nix index 64465bd2cc08d..d4cad21ba3027 100644 --- a/pkgs/by-name/vd/vdhcoapp/package.nix +++ b/pkgs/by-name/vd/vdhcoapp/package.nix @@ -5,7 +5,7 @@ nodejs, ffmpeg, callPackage, - substituteAll, + replaceVars, makeWrapper, toml2json, jq, @@ -32,8 +32,7 @@ buildNpmPackage rec { ]; patches = [ - (substituteAll { - src = ./ffmpeg-filepicker.patch; + (replaceVars ./ffmpeg-filepicker.patch { inherit ffmpeg; filepicker = lib.getExe (callPackage ./filepicker.nix { }); }) diff --git a/pkgs/by-name/ve/veracrypt/package.nix b/pkgs/by-name/ve/veracrypt/package.nix index fc41522a4b204..4f2c08feb3580 100644 --- a/pkgs/by-name/ve/veracrypt/package.nix +++ b/pkgs/by-name/ve/veracrypt/package.nix @@ -8,7 +8,7 @@ fuse, wxGTK32, lvm2, - substituteAll, + replaceVars, e2fsprogs, exfat, ntfs3g, @@ -27,8 +27,7 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { ext2 = "${e2fsprogs}/bin/mkfs.ext2"; ext3 = "${e2fsprogs}/bin/mkfs.ext3"; ext4 = "${e2fsprogs}/bin/mkfs.ext4"; diff --git a/pkgs/by-name/ve/vesktop/package.nix b/pkgs/by-name/ve/vesktop/package.nix index 9c3fedbf3ad63..0eb1d43b13188 100644 --- a/pkgs/by-name/ve/vesktop/package.nix +++ b/pkgs/by-name/ve/vesktop/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, makeBinaryWrapper, makeWrapper, makeDesktopItem, @@ -70,10 +70,11 @@ stdenv.mkDerivation (finalAttrs: { patches = [ ./disable_update_checking.patch ] - ++ lib.optional withSystemVencord (substituteAll { - inherit vencord; - src = ./use_system_vencord.patch; - }); + ++ lib.optional withSystemVencord ( + replaceVars ./use_system_vencord.patch { + inherit vencord; + } + ); env = { ELECTRON_SKIP_BINARY_DOWNLOAD = 1; diff --git a/pkgs/by-name/vy/vym/package.nix b/pkgs/by-name/vy/vym/package.nix index bafae7dad58ec..b0cc88f17a30f 100644 --- a/pkgs/by-name/vy/vym/package.nix +++ b/pkgs/by-name/vy/vym/package.nix @@ -5,7 +5,7 @@ pkg-config, qt5, stdenv, - substituteAll, + replaceVars, unzip, zip, }: @@ -35,8 +35,7 @@ stdenv.mkDerivation (finalAttrs: { ]; patches = [ - (substituteAll { - src = ./patches/0000-fix-zip-paths.diff; + (replaceVars ./patches/0000-fix-zip-paths.diff { zipPath = "${lib.getExe zip}"; unzipPath = "${lib.getExe unzip}"; }) diff --git a/pkgs/by-name/we/webcord-vencord/package.nix b/pkgs/by-name/we/webcord-vencord/package.nix index 2ac078def4eed..de047eb43990b 100644 --- a/pkgs/by-name/we/webcord-vencord/package.nix +++ b/pkgs/by-name/we/webcord-vencord/package.nix @@ -2,7 +2,7 @@ # allow overriding electron electron, webcord, - substituteAll, + replaceVars, lib, vencord-web-extension, }: @@ -12,8 +12,7 @@ pname = "webcord-vencord"; patches = (old.patches or [ ]) ++ [ - (substituteAll { - src = ./add-extension.patch; + (replaceVars ./add-extension.patch { vencord = vencord-web-extension; }) ]; diff --git a/pkgs/by-name/wi/wingpanel-indicator-ayatana/package.nix b/pkgs/by-name/wi/wingpanel-indicator-ayatana/package.nix index e5e97bede0c43..f50da741c1d31 100644 --- a/pkgs/by-name/wi/wingpanel-indicator-ayatana/package.nix +++ b/pkgs/by-name/wi/wingpanel-indicator-ayatana/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitHub, unstableGitUpdater, - substituteAll, + replaceVars, meson, ninja, pkg-config, @@ -27,8 +27,7 @@ stdenv.mkDerivation rec { patches = [ # Tells the indicator the path for libapplication.so - (substituteAll { - src = ./fix-libapplication-dir.patch; + (replaceVars ./fix-libapplication-dir.patch { indicator_application = indicator-application-gtk3; }) ]; diff --git a/pkgs/by-name/xb/xborders/package.nix b/pkgs/by-name/xb/xborders/package.nix index b61315d9d6a2c..ed5332d99058e 100644 --- a/pkgs/by-name/xb/xborders/package.nix +++ b/pkgs/by-name/xb/xborders/package.nix @@ -7,7 +7,7 @@ libnotify, wrapGAppsHook3, gobject-introspection, - substituteAll, + replaceVars, }: python3Packages.buildPythonPackage rec { @@ -40,8 +40,7 @@ python3Packages.buildPythonPackage rec { postPatch = let - setup = substituteAll { - src = ./setup.py; + setup = replaceVars ./setup.py { desc = meta.description; # "description" is reserved inherit pname version; }; diff --git a/pkgs/by-name/yo/you-get/package.nix b/pkgs/by-name/yo/you-get/package.nix index cabd00e67b380..2e4b9087713b3 100644 --- a/pkgs/by-name/yo/you-get/package.nix +++ b/pkgs/by-name/yo/you-get/package.nix @@ -2,7 +2,7 @@ lib, python3, fetchPypi, - substituteAll, + replaceVars, ffmpeg, installShellFiles, }: @@ -22,8 +22,7 @@ python3.pkgs.buildPythonApplication rec { }; patches = [ - (substituteAll { - src = ./ffmpeg-path.patch; + (replaceVars ./ffmpeg-path.patch { ffmpeg = "${lib.getBin ffmpeg}/bin/ffmpeg"; ffprobe = "${lib.getBin ffmpeg}/bin/ffmpeg"; version = lib.getVersion ffmpeg; diff --git a/pkgs/by-name/zs/zsh-powerlevel10k/package.nix b/pkgs/by-name/zs/zsh-powerlevel10k/package.nix index 2ca1cc0c4e0d3..574e1f966b276 100644 --- a/pkgs/by-name/zs/zsh-powerlevel10k/package.nix +++ b/pkgs/by-name/zs/zsh-powerlevel10k/package.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, gitstatus, bash, }: @@ -36,8 +36,7 @@ stdenv.mkDerivation rec { buildInputs = [ bash ]; patches = [ - (substituteAll { - src = ./gitstatusd.patch; + (replaceVars ./gitstatusd.patch { gitstatusdPath = "${gitstatus'}/bin/gitstatusd"; }) ]; diff --git a/pkgs/games/warsow/engine.nix b/pkgs/games/warsow/engine.nix index c824fadc8814d..0d2ef4cfaae1f 100644 --- a/pkgs/games/warsow/engine.nix +++ b/pkgs/games/warsow/engine.nix @@ -1,7 +1,7 @@ { stdenv, lib, - substituteAll, + replaceVars, fetchurl, cmake, libogg, @@ -27,8 +27,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./libpath.patch; + (replaceVars ./libpath.patch { inherit zlib curl diff --git a/pkgs/misc/my-env/default.nix b/pkgs/misc/my-env/default.nix index 710536e9869ae..1e48a93b16b21 100644 --- a/pkgs/misc/my-env/default.nix +++ b/pkgs/misc/my-env/default.nix @@ -58,7 +58,7 @@ { mkDerivation, - substituteAll, + replaceVars, pkgs, }: { @@ -80,8 +80,7 @@ mkDerivation { "buildPhase" "fixupPhase" ]; - setupNew = substituteAll { - src = ../../stdenv/generic/setup.sh; + setupNew = replaceVars ../../stdenv/generic/setup.sh { inherit gcc; }; diff --git a/pkgs/misc/tmux-plugins/tmux-fingers/default.nix b/pkgs/misc/tmux-plugins/tmux-fingers/default.nix index bb415d76935b7..b9cc9abb40bf0 100644 --- a/pkgs/misc/tmux-plugins/tmux-fingers/default.nix +++ b/pkgs/misc/tmux-plugins/tmux-fingers/default.nix @@ -1,6 +1,6 @@ { mkTmuxPlugin, - substituteAll, + replaceVars, fetchFromGitHub, crystal, }: @@ -38,8 +38,7 @@ mkTmuxPlugin { rtpFilePath = "tmux-fingers.tmux"; patches = [ - (substituteAll { - src = ./fix.patch; + (replaceVars ./fix.patch { tmuxFingersDir = "${fingers}/bin"; }) ]; diff --git a/pkgs/misc/tmux-plugins/tmux-thumbs/default.nix b/pkgs/misc/tmux-plugins/tmux-thumbs/default.nix index d7abae1ed23a8..31e66dbf67066 100644 --- a/pkgs/misc/tmux-plugins/tmux-thumbs/default.nix +++ b/pkgs/misc/tmux-plugins/tmux-thumbs/default.nix @@ -1,7 +1,7 @@ { mkTmuxPlugin, thumbs, - substituteAll, + replaceVars, }: mkTmuxPlugin { @@ -12,8 +12,7 @@ mkTmuxPlugin { rtpFilePath = "tmux-thumbs.tmux"; patches = [ - (substituteAll { - src = ./fix.patch; + (replaceVars ./fix.patch { tmuxThumbsDir = "${thumbs}/bin"; }) ]; diff --git a/pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix b/pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix index 7af27a8300bd5..b7a1496a37fe6 100644 --- a/pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix +++ b/pkgs/servers/sql/postgresql/ext/pgvecto-rs/default.nix @@ -11,7 +11,7 @@ postgresql, rustPlatform, stdenv, - substituteAll, + replaceVars, }: let @@ -42,8 +42,7 @@ in patches = [ # Tell the `c` crate to use the flags from the rust bindgen hook - (substituteAll { - src = ./0001-read-clang-flags-from-environment.diff; + (replaceVars ./0001-read-clang-flags-from-environment.diff { clang = lib.getExe clang; }) ]; diff --git a/pkgs/tools/audio/yabridge/default.nix b/pkgs/tools/audio/yabridge/default.nix index fc258317b1b22..ef97b99163f37 100644 --- a/pkgs/tools/audio/yabridge/default.nix +++ b/pkgs/tools/audio/yabridge/default.nix @@ -2,7 +2,7 @@ lib, multiStdenv, fetchFromGitHub, - substituteAll, + replaceVars, pkgsi686Linux, dbus, meson, @@ -99,8 +99,7 @@ multiStdenv.mkDerivation (finalAttrs: { patches = [ # Hard code bitbridge & runtime dependencies - (substituteAll { - src = ./hardcode-dependencies.patch; + (replaceVars ./hardcode-dependencies.patch { libdbus = dbus.lib; libxcb32 = pkgsi686Linux.xorg.libxcb; inherit wine; diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 391234ae1903d..034d74d7fbd36 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -3,7 +3,7 @@ , fetchFromGitLab , fetchFromGitHub , fetchurl -, substituteAll +, replaceVars , coreutils , curl , gnugrep @@ -127,8 +127,7 @@ stdenv.mkDerivation (finalAttrs: { # Hard code dependencies. Can't use makeWrapper since the Vulkan # layer can be used without the mangohud executable by setting MANGOHUD=1. - (substituteAll { - src = ./hardcode-dependencies.patch; + (replaceVars ./hardcode-dependencies.patch { path = lib.makeBinPath [ coreutils diff --git a/pkgs/tools/graphics/nifskope/default.nix b/pkgs/tools/graphics/nifskope/default.nix index 399d41ab1894d..609c75e6c1c82 100644 --- a/pkgs/tools/graphics/nifskope/default.nix +++ b/pkgs/tools/graphics/nifskope/default.nix @@ -5,7 +5,7 @@ qmake, qtbase, qttools, - substituteAll, + replaceVars, libGLU, wrapQtAppsHook, fetchpatch, @@ -25,8 +25,7 @@ stdenv.mkDerivation { patches = [ ./external-lib-paths.patch - (substituteAll { - src = ./qttools-bins.patch; + (replaceVars ./qttools-bins.patch { qttools = "${qttools.dev}/bin"; }) (fetchpatch { diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix index 74fd01fff8afd..0db733c430348 100644 --- a/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix +++ b/pkgs/tools/inputmethods/ibus-engines/ibus-hangul/default.nix @@ -2,7 +2,7 @@ lib, stdenv, fetchFromGitHub, - substituteAll, + replaceVars, appstream-glib, gettext, pkg-config, @@ -27,8 +27,7 @@ stdenv.mkDerivation rec { }; patches = [ - (substituteAll { - src = ./fix-paths.patch; + (replaceVars ./fix-paths.patch { libhangul = "${libhangul}/lib/libhangul.so.1"; }) ]; diff --git a/pkgs/tools/networking/bitmask-vpn/default.nix b/pkgs/tools/networking/bitmask-vpn/default.nix index 5c8cbbe06db77..bd7b819ecfea8 100644 --- a/pkgs/tools/networking/bitmask-vpn/default.nix +++ b/pkgs/tools/networking/bitmask-vpn/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, - substituteAll, + replaceVars, git, fetchFromGitLab, buildGoModule, @@ -74,8 +74,7 @@ buildGoModule rec { patches = [ # This patch fixes the paths in the build script generated by qmake # to use the correct paths for qmlcachegen and lrelease - (substituteAll { - src = ./fix_paths.patch; + (replaceVars ./fix_paths.patch { inherit qtbase qtdeclarative qttools; }) diff --git a/pkgs/tools/networking/ebpf-verifier/default.nix b/pkgs/tools/networking/ebpf-verifier/default.nix index 431d842947194..cd31356411c23 100644 --- a/pkgs/tools/networking/ebpf-verifier/default.nix +++ b/pkgs/tools/networking/ebpf-verifier/default.nix @@ -6,7 +6,7 @@ cmake, catch2, pkg-config, - substituteAll, + replaceVars, yaml-cpp, }: @@ -23,9 +23,8 @@ stdenv.mkDerivation { }; patches = [ - (substituteAll { + (replaceVars ./remove-fetchcontent-usage.patch { # We will download them instead of cmake's fetchContent - src = ./remove-fetchcontent-usage.patch; catch2Src = catch2.src; }) ]; diff --git a/pkgs/tools/networking/edgedb/default.nix b/pkgs/tools/networking/edgedb/default.nix index 6a10d7e42fdf7..e52c3b6dfc881 100644 --- a/pkgs/tools/networking/edgedb/default.nix +++ b/pkgs/tools/networking/edgedb/default.nix @@ -9,7 +9,7 @@ curl, openssl, xz, - substituteAll, + replaceVars, # for passthru.tests: edgedb, testers, @@ -50,8 +50,7 @@ rustPlatform.buildRustPackage rec { checkFeatures = [ ]; patches = [ - (substituteAll { - src = ./0001-dynamically-patchelf-binaries.patch; + (replaceVars ./0001-dynamically-patchelf-binaries.patch { inherit patchelf; dynamicLinker = stdenv.cc.bintools.dynamicLinker; }) diff --git a/pkgs/tools/package-management/protontricks/default.nix b/pkgs/tools/package-management/protontricks/default.nix index 13b7158e79697..700c4bd21d404 100644 --- a/pkgs/tools/package-management/protontricks/default.nix +++ b/pkgs/tools/package-management/protontricks/default.nix @@ -2,7 +2,7 @@ lib, buildPythonApplication, fetchFromGitHub, - substituteAll, + replaceVars, writeShellScript, steam-run, fetchpatch2, @@ -30,8 +30,7 @@ buildPythonApplication rec { patches = [ # Use steam-run to run Proton binaries - (substituteAll { - src = ./steam-run.patch; + (replaceVars ./steam-run.patch { steamRun = lib.getExe steam-run; bash = writeShellScript "steam-run-bash" '' exec ${lib.getExe steam-run} bash "$@" diff --git a/pkgs/tools/security/keybase/default.nix b/pkgs/tools/security/keybase/default.nix index 44ec908dcf547..c58852e05ab84 100644 --- a/pkgs/tools/security/keybase/default.nix +++ b/pkgs/tools/security/keybase/default.nix @@ -1,6 +1,6 @@ { stdenv, - substituteAll, + replaceVars, lib, buildGoModule, fetchFromGitHub, @@ -36,8 +36,7 @@ buildGoModule rec { vendorHash = "sha256-KHahkGzkXr6xp0XY9MyEeeiHnmphaNYi9dPBQ476+us="; patches = [ - (substituteAll { - src = ./fix-paths-keybase.patch; + (replaceVars ./fix-paths-keybase.patch { gpg = "${gnupg}/bin/gpg"; gpg2 = "${gnupg}/bin/gpg2"; })