treewide: replace substituteAll with replaceVars (part 3)

Driving #237216 forward.
This commit is contained in:
Wolfgang Walther 2025-01-12 13:54:00 +01:00
parent 3ab4abae1d
commit b12e9707e0
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
51 changed files with 110 additions and 169 deletions

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchurl, fetchurl,
substituteAll, replaceVars,
pkg-config, pkg-config,
glib, glib,
shadow, shadow,
@ -36,8 +36,7 @@ stdenv.mkDerivation rec {
patches = [ patches = [
# Hardcode dependency paths. # Hardcode dependency paths.
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit shadow coreutils; inherit shadow coreutils;
}) })

View file

@ -2,7 +2,7 @@
lib, lib,
rustPlatform, rustPlatform,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
nix-update-script, nix-update-script,
pkg-config, pkg-config,
autoAddDriverRunpath, autoAddDriverRunpath,
@ -59,8 +59,7 @@ rustPlatform.buildRustPackage rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-finding-libs.patch {
src = ./fix-finding-libs.patch;
ffmpeg = lib.getDev ffmpeg; ffmpeg = lib.getDev ffmpeg;
x264 = lib.getDev x264; x264 = lib.getDev x264;
}) })

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
docbook_xml_dtd_42, docbook_xml_dtd_42,
docbook_xsl, docbook_xsl,
fontconfig, fontconfig,
@ -74,8 +74,7 @@ stdenv.mkDerivation rec {
]; ];
patches = [ patches = [
(substituteAll { (replaceVars ./paths.patch {
src = ./paths.patch;
pngquant = "${pngquant}/bin/pngquant"; pngquant = "${pngquant}/bin/pngquant";
}) })
]; ];

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
binutils, binutils,
asciidoctor, asciidoctor,
cmake, cmake,
@ -54,8 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
# Darwin. # Darwin.
# Additionally, when cross compiling, the correct target prefix # Additionally, when cross compiling, the correct target prefix
# needs to be set. # needs to be set.
(substituteAll { (replaceVars ./fix-objdump-path.patch {
src = ./fix-objdump-path.patch;
objdump = "${binutils.bintools}/bin/${binutils.targetPrefix}objdump"; objdump = "${binutils.bintools}/bin/${binutils.targetPrefix}objdump";
}) })
]; ];

View file

@ -1,7 +1,7 @@
{ lib { lib
, stdenv , stdenv
, fetchurl , fetchurl
, substituteAll , replaceVars
, buildPackages , buildPackages
, bzip2 , bzip2
, curlMinimal , curlMinimal
@ -75,8 +75,7 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional stdenv.hostPlatform.isDarwin ./006-darwin-always-set-runtime-c-flag.diff ++ 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. # 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) ( ++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) (
substituteAll { replaceVars ./007-darwin-bsd-ps-abspath.diff {
src = ./007-darwin-bsd-ps-abspath.diff;
ps = lib.getExe ps; ps = lib.getExe ps;
}) })
++ [ ++ [

View file

@ -46,7 +46,7 @@
python3, python3,
shared-mime-info, shared-mime-info,
socat, socat,
substituteAll, replaceVars,
systemd, systemd,
testers, testers,
valgrind, valgrind,
@ -84,8 +84,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [ patches = [
# Hardcode paths used by tests and change test runtime generation to use files from Nix store. # Hardcode paths used by tests and change test runtime generation to use files from Nix store.
# https://github.com/flatpak/flatpak/issues/1460 # https://github.com/flatpak/flatpak/issues/1460
(substituteAll { (replaceVars ./fix-test-paths.patch {
src = ./fix-test-paths.patch;
inherit inherit
coreutils coreutils
gettext gettext
@ -98,8 +97,7 @@ stdenv.mkDerivation (finalAttrs: {
}) })
# Hardcode paths used by Flatpak itself. # Hardcode paths used by Flatpak itself.
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
p11kit = "${p11-kit.bin}/bin/p11-kit"; p11kit = "${p11-kit.bin}/bin/p11-kit";
}) })
@ -235,8 +233,7 @@ stdenv.mkDerivation (finalAttrs: {
''; '';
passthru = { passthru = {
icon-validator-patch = substituteAll { icon-validator-patch = replaceVars ./fix-icon-validation.patch {
src = ./fix-icon-validation.patch;
inherit (builtins) storeDir; inherit (builtins) storeDir;
}; };

View file

@ -9,7 +9,7 @@
pkg-config, pkg-config,
pantheon, pantheon,
python3, python3,
substituteAll, replaceVars,
glib, glib,
gtk3, gtk3,
dosfstools, dosfstools,
@ -33,8 +33,7 @@ stdenv.mkDerivation rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
ext4 = "${e2fsprogs}/bin/mkfs.ext4"; ext4 = "${e2fsprogs}/bin/mkfs.ext4";
exfat = "${exfat}/bin/mkfs.exfat"; exfat = "${exfat}/bin/mkfs.exfat";
fat = "${dosfstools}/bin/mkfs.fat"; fat = "${dosfstools}/bin/mkfs.fat";

View file

@ -3,7 +3,7 @@
stdenv, stdenv,
fetchurl, fetchurl,
fetchpatch, fetchpatch,
substituteAll, replaceVars,
meson, meson,
ninja, ninja,
pkg-config, pkg-config,
@ -35,8 +35,7 @@
let let
override = substituteAll { override = replaceVars ./org.gnome.login-screen.gschema.override {
src = ./org.gnome.login-screen.gschema.override;
icon = "${nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake-white.svg"; 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. # Change hardcoded paths to nix store paths.
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit inherit
coreutils coreutils
plymouth plymouth

View file

@ -2,7 +2,7 @@
stdenv, stdenv,
lib, lib,
fetchurl, fetchurl,
substituteAll, replaceVars,
meson, meson,
ninja, ninja,
nixosTests, nixosTests,
@ -33,8 +33,7 @@ stdenv.mkDerivation rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./hardcode-gsettings.patch {
src = ./hardcode-gsettings.patch;
gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas; gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas;
}) })

View file

@ -2,7 +2,7 @@
fetchurl, fetchurl,
lib, lib,
stdenv, stdenv,
substituteAll, replaceVars,
accountsservice, accountsservice,
adwaita-icon-theme, adwaita-icon-theme,
colord, colord,
@ -82,8 +82,7 @@ stdenv.mkDerivation (finalAttrs: {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./paths.patch {
src = ./paths.patch;
gcm = gnome-color-manager; gcm = gnome-color-manager;
inherit glibc tzdata shadow; inherit glibc tzdata shadow;
inherit cups networkmanagerapplet; inherit cups networkmanagerapplet;

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchurl, fetchurl,
substituteAll, replaceVars,
pkg-config, pkg-config,
libxslt, libxslt,
ninja, ninja,
@ -44,8 +44,7 @@ stdenv.mkDerivation rec {
}; };
patches = lib.optionals stdenv.hostPlatform.isLinux [ patches = lib.optionals stdenv.hostPlatform.isLinux [
(substituteAll { (replaceVars ./bubblewrap-paths.patch {
src = ./bubblewrap-paths.patch;
bubblewrap_bin = "${bubblewrap}/bin/bwrap"; bubblewrap_bin = "${bubblewrap}/bin/bwrap";
inherit (builtins) storeDir; inherit (builtins) storeDir;
}) })

View file

@ -2,7 +2,7 @@
stdenv, stdenv,
lib, lib,
fetchurl, fetchurl,
substituteAll, replaceVars,
dconf, dconf,
gettext, gettext,
meson, meson,
@ -45,8 +45,7 @@ stdenv.mkDerivation (finalAttrs: {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./0001-fix-paths.patch {
src = ./0001-fix-paths.patch;
inherit tzdata; inherit tzdata;
tecla = gnome-tecla; tecla = gnome-tecla;
}) })

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
meson, meson,
ninja, ninja,
pkg-config, pkg-config,
@ -36,8 +36,7 @@ stdenv.mkDerivation rec {
patches = [ patches = [
# Our glib setup hooks moves GSettings schemas to a subdirectory to prevent conflicts. # 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. # We need to patch the build script so that the extension can find them.
(substituteAll { (replaceVars ./fix-schema-path.patch {
src = ./fix-schema-path.patch;
inherit pname version; inherit pname version;
}) })
]; ];

View file

@ -2,7 +2,7 @@
fetchurl, fetchurl,
lib, lib,
stdenv, stdenv,
substituteAll, replaceVars,
meson, meson,
ninja, ninja,
pkg-config, pkg-config,
@ -47,8 +47,7 @@ stdenv.mkDerivation (finalAttrs: {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
gsettings = "${glib.bin}/bin/gsettings"; gsettings = "${glib.bin}/bin/gsettings";
dbusLaunch = "${dbus.lib}/bin/dbus-launch"; dbusLaunch = "${dbus.lib}/bin/dbus-launch";
bash = "${bash}/bin/bash"; bash = "${bash}/bin/bash";

View file

@ -1,7 +1,7 @@
{ {
stdenv, stdenv,
lib, lib,
substituteAll, replaceVars,
buildPackages, buildPackages,
fetchurl, fetchurl,
meson, meson,
@ -54,8 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
# https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202 # https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202
./add-gnome-session-ctl-option.patch ./add-gnome-session-ctl-option.patch
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit tzdata; inherit tzdata;
}) })
]; ];

View file

@ -1,7 +1,7 @@
{ {
stdenv, stdenv,
lib, lib,
substituteAll, replaceVars,
fetchurl, fetchurl,
meson, meson,
ninja, ninja,
@ -51,8 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
# https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202 # https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/202
./add-gnome-session-ctl-option.patch ./add-gnome-session-ctl-option.patch
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit tzdata; inherit tzdata;
}) })
]; ];

View file

@ -10,7 +10,7 @@
glib, glib,
gnome, gnome,
gnome-menus, gnome-menus,
substituteAll, replaceVars,
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
@ -23,12 +23,10 @@ stdenv.mkDerivation (finalAttrs: {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix_gmenu.patch {
src = ./fix_gmenu.patch;
gmenu_path = "${gnome-menus}/lib/girepository-1.0"; gmenu_path = "${gnome-menus}/lib/girepository-1.0";
}) })
(substituteAll { (replaceVars ./fix_gtop.patch {
src = ./fix_gtop.patch;
gtop_path = "${libgtop}/lib/girepository-1.0"; gtop_path = "${libgtop}/lib/girepository-1.0";
}) })
]; ];

View file

@ -1,7 +1,7 @@
{ {
fetchurl, fetchurl,
fetchpatch, fetchpatch,
substituteAll, replaceVars,
lib, lib,
stdenv, stdenv,
docutils, docutils,
@ -84,8 +84,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [ patches = [
# Hardcode paths to various dependencies so that they can be found at runtime. # Hardcode paths to various dependencies so that they can be found at runtime.
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
glib_compile_schemas = "${glib.dev}/bin/glib-compile-schemas"; glib_compile_schemas = "${glib.dev}/bin/glib-compile-schemas";
gsettings = "${glib.bin}/bin/gsettings"; gsettings = "${glib.bin}/bin/gsettings";
tecla = "${lib.getBin gnome-tecla}/bin/tecla"; tecla = "${lib.getBin gnome-tecla}/bin/tecla";

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchurl, fetchurl,
substituteAll, replaceVars,
pkg-config, pkg-config,
meson, meson,
ninja, ninja,
@ -56,8 +56,7 @@ stdenv.mkDerivation (finalAttrs: {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit isocodes; inherit isocodes;
}) })
]; ];

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
c-ares, c-ares,
cmake, cmake,
crc32c, crc32c,
@ -43,8 +43,7 @@ stdenv.mkDerivation rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./hardcode-googleapis-path.patch {
src = ./hardcode-googleapis-path.patch;
url = googleapis; url = googleapis;
}) })
]; ];

View file

@ -20,7 +20,7 @@
util-linux, util-linux,
polkit, polkit,
wrapGAppsHook3, wrapGAppsHook3,
substituteAll, replaceVars,
mtools, mtools,
dosfstools, dosfstools,
xhost, xhost,
@ -39,8 +39,7 @@ stdenv.mkDerivation rec {
# however the binary won't be suid so it returns # however the binary won't be suid so it returns
# an error preventing the program from detection # an error preventing the program from detection
patches = [ patches = [
(substituteAll { (replaceVars ./polkit.patch {
src = ./polkit.patch;
polkit_version = polkit.version; polkit_version = polkit.version;
}) })
]; ];

View file

@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
meson, meson,
ninja, ninja,
pkg-config, pkg-config,
@ -46,8 +46,7 @@ stdenv.mkDerivation rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-python-path.patch {
src = ./fix-python-path.patch;
python = "${pythonEnv}/bin/python3"; python = "${pythonEnv}/bin/python3";
}) })
]; ];

View file

@ -5,7 +5,7 @@
meson, meson,
ninja, ninja,
pkg-config, pkg-config,
substituteAll, replaceVars,
gettext, gettext,
dbus, dbus,
glib, glib,
@ -55,8 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./hardcode-ssh-path.patch {
src = ./hardcode-ssh-path.patch;
ssh_program = "${lib.getBin openssh}/bin/ssh"; ssh_program = "${lib.getBin openssh}/bin/ssh";
}) })
]; ];

View file

@ -6,7 +6,7 @@
scdoc, scdoc,
tzdata, tzdata,
mailcap, mailcap,
substituteAll, replaceVars,
callPackage, callPackage,
enableCrossCompilation ? (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.is64bit), enableCrossCompilation ? (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.is64bit),
pkgsCross, pkgsCross,
@ -92,22 +92,19 @@ stdenv.mkDerivation (finalAttrs: {
patches = [ patches = [
# Replace FHS paths with nix store # Replace FHS paths with nix store
(substituteAll { (replaceVars ./001-tzdata.patch {
src = ./001-tzdata.patch;
inherit tzdata; inherit tzdata;
}) })
# Don't build haredoc since it uses the build `hare` bin, which breaks # Don't build haredoc since it uses the build `hare` bin, which breaks
# cross-compilation. # cross-compilation.
./002-dont-build-haredoc.patch ./002-dont-build-haredoc.patch
# Hardcode harec and qbe. # Hardcode harec and qbe.
(substituteAll { (replaceVars ./003-hardcode-qbe-and-harec.patch {
src = ./003-hardcode-qbe-and-harec.patch;
harec_bin = lib.getExe harec; harec_bin = lib.getExe harec;
qbe_bin = lib.getExe qbe; qbe_bin = lib.getExe qbe;
}) })
# Use mailcap `/etc/mime.types` for Hare's mime module # Use mailcap `/etc/mime.types` for Hare's mime module
(substituteAll { (replaceVars ./004-use-mailcap-for-mimetypes.patch {
src = ./004-use-mailcap-for-mimetypes.patch;
inherit mailcap; inherit mailcap;
}) })
]; ];

View file

@ -7,7 +7,7 @@
nix-update-script, nix-update-script,
makeWrapper, makeWrapper,
bash, bash,
substituteAll, replaceVars,
}: }:
stdenv.mkDerivation (finalAttrs: { stdenv.mkDerivation (finalAttrs: {
pname = "haredo"; pname = "haredo";
@ -27,8 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [ patches = [
# Use nix store's bash instead of sh. `@bash@/bin/sh` is used, since haredo expects a posix shell. # Use nix store's bash instead of sh. `@bash@/bin/sh` is used, since haredo expects a posix shell.
(substituteAll { (replaceVars ./001-use-nix-store-sh.patch {
src = ./001-use-nix-store-sh.patch;
inherit bash; inherit bash;
}) })
]; ];

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, tzdata, fetchpatch, substituteAll }: { lib, stdenv, fetchFromGitHub, cmake, tzdata, fetchpatch, replaceVars }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "howard-hinnant-date"; pname = "howard-hinnant-date";
@ -22,8 +22,7 @@ stdenv.mkDerivation rec {
# Without this patch, this library will drop a `tzdata` directory into # Without this patch, this library will drop a `tzdata` directory into
# `~/Downloads` if it cannot find `/usr/share/zoneinfo`. Make the path it # `~/Downloads` if it cannot find `/usr/share/zoneinfo`. Make the path it
# searches for `zoneinfo` be the one from the `tzdata` package. # searches for `zoneinfo` be the one from the `tzdata` package.
(substituteAll { (replaceVars ./make-zoneinfo-available.diff {
src = ./make-zoneinfo-available.diff;
inherit tzdata; inherit tzdata;
}) })
]; ];

View file

@ -3,7 +3,7 @@
stdenv, stdenv,
fetchFromGitLab, fetchFromGitLab,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
symlinkJoin, symlinkJoin,
cmake, cmake,
doxygen, doxygen,
@ -24,9 +24,8 @@ stdenv.mkDerivation (finalAttrs: {
}; };
patches = lib.optionals finalAttrs.finalPackage.doCheck [ patches = lib.optionals finalAttrs.finalPackage.doCheck [
(substituteAll { (replaceVars ./remove-fetchcontent-usage.patch {
# Do not let cmake's fetchContent download unity # Do not let cmake's fetchContent download unity
src = ./remove-fetchcontent-usage.patch;
unitySrc = symlinkJoin { unitySrc = symlinkJoin {
name = "unity-with-iniparser-config"; name = "unity-with-iniparser-config";
paths = [ paths = [

View file

@ -2,7 +2,7 @@
lib, lib,
fetchurl, fetchurl,
stdenv, stdenv,
substituteAll, replaceVars,
vim, vim,
sendmailPath ? "/usr/sbin/sendmail", sendmailPath ? "/usr/sbin/sendmail",
}: }:
@ -17,8 +17,7 @@ stdenv.mkDerivation (finalAttrs: {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./0000-nixpkgs-specific.diff {
src = ./0000-nixpkgs-specific.diff;
inherit sendmailPath; inherit sendmailPath;
viPath = lib.getExe' vim "vim"; viPath = lib.getExe' vim "vim";
defPath = lib.concatStringsSep ":" [ defPath = lib.concatStringsSep ":" [

View file

@ -19,7 +19,7 @@
ocl-icd, ocl-icd,
# include non-free ClamAV unrar code # include non-free ClamAV unrar code
enableUnfree ? false, enableUnfree ? false,
substituteAll, replaceVars,
makeWrapper, makeWrapper,
}: }:
@ -35,8 +35,7 @@ stdenv.mkDerivation rec {
}; };
patches = lib.optionals withOpenCL [ patches = lib.optionals withOpenCL [
(substituteAll { (replaceVars ./opencl.patch {
src = ./opencl.patch;
ocl_icd = ocl-icd; ocl_icd = ocl-icd;
}) })
]; ];

View file

@ -6,7 +6,7 @@
mono, mono,
makeWrapper, makeWrapper,
icoutils, icoutils,
substituteAll, replaceVars,
xsel, xsel,
xorg, xorg,
xdotool, xdotool,
@ -37,8 +37,7 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ icoutils ]; buildInputs = [ icoutils ];
patches = [ patches = [
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
xsel = "${xsel}/bin/xsel"; xsel = "${xsel}/bin/xsel";
xprop = "${xorg.xprop}/bin/xprop"; xprop = "${xorg.xprop}/bin/xprop";
xdotool = "${xdotool}/bin/xdotool"; xdotool = "${xdotool}/bin/xdotool";

View file

@ -2,7 +2,7 @@
lib, lib,
rustPlatform, rustPlatform,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
stdenv, stdenv,
}: }:
@ -20,8 +20,7 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-zkPLas+fQQzm7LlWNpTooUR/e30KMS9OET6PMwQ2yAA="; cargoHash = "sha256-zkPLas+fQQzm7LlWNpTooUR/e30KMS9OET6PMwQ2yAA=";
patches = [ patches = [
(substituteAll { (replaceVars ./use-correct-binary-path-in-tests.patch {
src = ./use-correct-binary-path-in-tests.patch;
target_triple = stdenv.hostPlatform.rust.rustcTarget; target_triple = stdenv.hostPlatform.rust.rustcTarget;
}) })
]; ];

View file

@ -19,7 +19,7 @@
perl, perl,
hwdata, hwdata,
osinfo-db, osinfo-db,
substituteAll, replaceVars,
vala ? null, vala ? null,
}: }:
@ -61,8 +61,7 @@ stdenv.mkDerivation rec {
]; ];
patches = [ patches = [
(substituteAll { (replaceVars ./osinfo-db-data-dir.patch {
src = ./osinfo-db-data-dir.patch;
osinfo_db_data_dir = "${osinfo-db}/share"; osinfo_db_data_dir = "${osinfo-db}/share";
}) })

View file

@ -13,7 +13,7 @@
libstartup_notification, libstartup_notification,
libxml2, libxml2,
pkg-config, pkg-config,
substituteAll, replaceVars,
wrapGAppsHook3, wrapGAppsHook3,
zenity, zenity,
}: }:
@ -28,8 +28,7 @@ stdenv.mkDerivation rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit zenity; inherit zenity;
}) })
]; ];

View file

@ -8,7 +8,7 @@
libnotify, libnotify,
python3Packages, python3Packages,
steam-run, steam-run,
substituteAll, replaceVars,
unzip, unzip,
webkitgtk_4_0, webkitgtk_4_0,
wrapGAppsHook3, wrapGAppsHook3,
@ -26,8 +26,7 @@ python3Packages.buildPythonApplication rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./inject-launcher-steam-run.diff {
src = ./inject-launcher-steam-run.diff;
steamrun = lib.getExe steam-run; steamrun = lib.getExe steam-run;
}) })
]; ];

View file

@ -7,7 +7,7 @@
installShellFiles, installShellFiles,
makeWrapper, makeWrapper,
nodejs, nodejs,
substituteAll, replaceVars,
v4l-utils, v4l-utils,
which, which,
}: }:
@ -46,8 +46,7 @@ buildNpmPackage rec {
nodejs nodejs
which which
] ++ lib.optionals stdenv.hostPlatform.isLinux [ v4l-utils ]; ] ++ lib.optionals stdenv.hostPlatform.isLinux [ v4l-utils ];
crc32Patch = substituteAll { crc32Patch = replaceVars ./fix-musl-detection.patch {
src = ./fix-musl-detection.patch;
isMusl = if stdenv.hostPlatform.isMusl then "true" else "false"; isMusl = if stdenv.hostPlatform.isMusl then "true" else "false";
}; };
in in

View file

@ -2,7 +2,7 @@
stdenv, stdenv,
lib, lib,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
cairo, cairo,
cinnamon-desktop, cinnamon-desktop,
dbus, dbus,
@ -58,8 +58,7 @@ stdenv.mkDerivation rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit zenity; inherit zenity;
}) })
]; ];

View file

@ -4,7 +4,7 @@
fetchFromGitHub, fetchFromGitHub,
ffmpeg-headless, ffmpeg-headless,
nixosTests, nixosTests,
substituteAll, replaceVars,
providers ? [ ], providers ? [ ],
}: }:
@ -38,8 +38,7 @@ python.pkgs.buildPythonApplication rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./ffmpeg.patch {
src = ./ffmpeg.patch;
ffmpeg = "${lib.getBin ffmpeg-headless}/bin/ffmpeg"; ffmpeg = "${lib.getBin ffmpeg-headless}/bin/ffmpeg";
ffprobe = "${lib.getBin ffmpeg-headless}/bin/ffprobe"; ffprobe = "${lib.getBin ffmpeg-headless}/bin/ffprobe";
}) })

View file

@ -1,7 +1,7 @@
{ {
stdenv, stdenv,
lib, lib,
substituteAll, replaceVars,
fetchurl, fetchurl,
meson, meson,
ninja, ninja,
@ -32,8 +32,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [ patches = [
# Make PyGObjects gi library available. # Make PyGObjects gi library available.
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [ pythonPaths = lib.concatMapStringsSep ", " (pkg: "'${pkg}/${python3.sitePackages}'") [
python3.pkgs.pygobject3 python3.pkgs.pygobject3
]; ];

View file

@ -17,7 +17,7 @@
net-snmp, net-snmp,
openssl, openssl,
pkg-config, pkg-config,
substituteAll, replaceVars,
systemd, systemd,
udev, udev,
gnused, gnused,
@ -40,8 +40,7 @@ stdenv.mkDerivation rec {
# trying to install directly into /etc/nut which predictably fails # trying to install directly into /etc/nut which predictably fails
./nutshutdown-conf-default.patch ./nutshutdown-conf-default.patch
(substituteAll { (replaceVars ./hardcode-paths.patch {
src = ./hardcode-paths.patch;
avahi = "${avahi}/lib"; avahi = "${avahi}/lib";
freeipmi = "${freeipmi}/lib"; freeipmi = "${freeipmi}/lib";
libgpiod = "${libgpiod_1}/lib"; libgpiod = "${libgpiod_1}/lib";

View file

@ -6,7 +6,7 @@
fetchFromGitHub, fetchFromGitHub,
fetchPypi, fetchPypi,
python3, python3,
substituteAll, replaceVars,
nix-update-script, nix-update-script,
nixosTests, nixosTests,
# To include additional plugins, pass them here as an overlay. # To include additional plugins, pass them here as an overlay.
@ -194,14 +194,12 @@ let
patches = [ patches = [
# substitute pip and let it find out, that it can't write anywhere # substitute pip and let it find out, that it can't write anywhere
(substituteAll { (replaceVars ./pip-path.patch {
src = ./pip-path.patch;
pip = "${self.pip}/bin/pip"; pip = "${self.pip}/bin/pip";
}) })
# hardcore path to ffmpeg and hide related settings # hardcore path to ffmpeg and hide related settings
(substituteAll { (replaceVars ./ffmpeg-path.patch {
src = ./ffmpeg-path.patch;
ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg"; ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg";
}) })
]; ];

View file

@ -3,7 +3,7 @@
fetchpatch, fetchpatch,
stdenv, stdenv,
lib, lib,
substituteAll, replaceVars,
aspellWithDicts, aspellWithDicts,
at-spi2-core ? null, at-spi2-core ? null,
atspiSupport ? true, atspiSupport ? true,
@ -51,8 +51,7 @@ python3.pkgs.buildPythonApplication rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit mousetweaks; inherit mousetweaks;
}) })
# Allow loading hunspell dictionaries installed in NixOS system path # Allow loading hunspell dictionaries installed in NixOS system path

View file

@ -12,7 +12,7 @@
python3, python3,
gtk3, gtk3,
gnome, gnome,
substituteAll, replaceVars,
at-spi2-atk, at-spi2-atk,
at-spi2-core, at-spi2-core,
dbus, dbus,
@ -39,8 +39,7 @@ python3.pkgs.buildPythonApplication rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
cat = "${coreutils}/bin/cat"; cat = "${coreutils}/bin/cat";
lsof = "${lsof}/bin/lsof"; lsof = "${lsof}/bin/lsof";
pgrep = "${procps}/bin/pgrep"; pgrep = "${procps}/bin/pgrep";

View file

@ -1,21 +1,19 @@
{ {
substituteAll, replaceVars,
diffutils, diffutils,
stdenv, stdenv,
patchPpdFilesHook, patchPpdFilesHook,
}: }:
let let
input = substituteAll { input = replaceVars ./test.ppd {
src = ./test.ppd;
keep = "cmp"; keep = "cmp";
patch = "cmp"; patch = "cmp";
pathkeep = "/bin/cmp"; pathkeep = "/bin/cmp";
pathpatch = "/bin/cmp"; pathpatch = "/bin/cmp";
}; };
output = substituteAll { output = replaceVars ./test.ppd {
src = ./test.ppd;
keep = "cmp"; keep = "cmp";
patch = "${diffutils}/bin/cmp"; patch = "${diffutils}/bin/cmp";
pathkeep = "/bin/cmp"; pathkeep = "/bin/cmp";

View file

@ -3,7 +3,7 @@
stdenv, stdenv,
fetchFromGitLab, fetchFromGitLab,
writeText, writeText,
substituteAll, replaceVars,
meson, meson,
pkg-config, pkg-config,
ninja, ninja,
@ -44,8 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
# add support for loading plugins from /run to assist NixOS module # add support for loading plugins from /run to assist NixOS module
./add-runtime-plugin-path.patch ./add-runtime-plugin-path.patch
# fix FHS hardcoded paths # fix FHS hardcoded paths
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
fcmatch = "${fontconfig}/bin/fc-match"; fcmatch = "${fontconfig}/bin/fc-match";
}) })
]; ];

View file

@ -19,7 +19,7 @@
makeWrapper, makeWrapper,
runtimeShell, runtimeShell,
symlinkJoin, symlinkJoin,
substituteAll, replaceVars,
extraPackages ? [ ], extraPackages ? [ ],
crun, crun,
runc, runc,
@ -85,8 +85,7 @@ buildGoModule rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./hardcode-paths.patch {
src = ./hardcode-paths.patch;
bin_path = helpersBin; bin_path = helpersBin;
}) })

View file

@ -2,7 +2,7 @@
lib, lib,
buildPythonPackage, buildPythonPackage,
fetchFromGitHub, fetchFromGitHub,
substituteAll, replaceVars,
# build-system # build-system
pretix-plugin-build, pretix-plugin-build,
@ -29,8 +29,7 @@ buildPythonPackage rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./passbook-openssl.patch {
src = ./passbook-openssl.patch;
openssl = lib.getExe openssl; openssl = lib.getExe openssl;
}) })
]; ];

View file

@ -2,7 +2,7 @@
lib, lib,
python3Packages, python3Packages,
fetchPypi, fetchPypi,
substituteAll, replaceVars,
ffmpeg, ffmpeg,
}: }:
@ -17,8 +17,7 @@ python3Packages.buildPythonApplication rec {
}; };
patches = [ patches = [
(substituteAll { (replaceVars ./ffmpeg-path.patch {
src = ./ffmpeg-path.patch;
ffmpeg = lib.getExe ffmpeg; ffmpeg = lib.getExe ffmpeg;
}) })
]; ];

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, substituteAll, swaybg { lib, stdenv, fetchFromGitHub, fetchpatch, replaceVars, swaybg
, meson, ninja, pkg-config, wayland-scanner, scdoc , meson, ninja, pkg-config, wayland-scanner, scdoc
, libGL, wayland, libxkbcommon, pcre2, json_c, libevdev , libGL, wayland, libxkbcommon, pcre2, json_c, libevdev
, pango, cairo, libinput, gdk-pixbuf, librsvg , pango, cairo, libinput, gdk-pixbuf, librsvg
@ -26,8 +26,7 @@ stdenv.mkDerivation (finalAttrs: {
patches = [ patches = [
./load-configuration-from-etc.patch ./load-configuration-from-etc.patch
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit swaybg; inherit swaybg;
}) })

View file

@ -4,7 +4,7 @@
stdenv, stdenv,
systemd, systemd,
meson, meson,
substituteAll, replaceVars,
swaybg, swaybg,
ninja, ninja,
pkg-config, pkg-config,
@ -57,8 +57,7 @@ stdenv.mkDerivation (finalAttrs: {
[ [
./load-configuration-from-etc.patch ./load-configuration-from-etc.patch
(substituteAll { (replaceVars ./fix-paths.patch {
src = ./fix-paths.patch;
inherit swaybg; inherit swaybg;
}) })
] ]

View file

@ -13,7 +13,7 @@
ninja, ninja,
pkg-config, pkg-config,
python3, python3,
substituteAll, replaceVars,
systemdMinimal, systemdMinimal,
usbutils, usbutils,
vala, vala,
@ -44,8 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
# Replace references to udevadm with an absolute paths, so programs using # Replace references to udevadm with an absolute paths, so programs using
# umockdev will just work without having to provide it in their test environment # umockdev will just work without having to provide it in their test environment
# $PATH. # $PATH.
(substituteAll { (replaceVars ./substitute-udevadm.patch {
src = ./substitute-udevadm.patch;
udevadm = "${systemdMinimal}/bin/udevadm"; udevadm = "${systemdMinimal}/bin/udevadm";
}) })
]; ];

View file

@ -29,7 +29,7 @@
forceInstallAllHacks ? true, forceInstallAllHacks ? true,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
nixosTests, nixosTests,
substituteAll, replaceVars,
wrapperPrefix ? "/run/wrappers/bin", wrapperPrefix ? "/run/wrappers/bin",
}: }:
@ -83,8 +83,7 @@ stdenv.mkDerivation (finalAttrs: {
''; '';
patches = [ patches = [
(substituteAll { (replaceVars ./xscreensaver-wrapper-prefix.patch {
src = ./xscreensaver-wrapper-prefix.patch;
inherit wrapperPrefix; inherit wrapperPrefix;
}) })
]; ];