refactor: substituteAll -> replaceVars

This commit is contained in:
isabel
2025-05-09 20:12:59 +01:00
parent 20e4702906
commit d42da140a6
2 changed files with 12 additions and 7 deletions
+6 -3
View File
@@ -132,13 +132,16 @@ let
'' + (lib.optionalString (cfg.extraEnv != {})
(lib.concatLines (lib.mapAttrsToList (name: value: "export ${name}=${lib.escapeShellArg value}") cfg.extraEnv)))
+ (builtins.readFile ./brew.tail.sh));
in pkgs.substituteAll {
in pkgs.replaceVarsWith {
name = "brew";
src = template;
isExecutable = true;
inherit runtimePath;
inherit (prefix) prefix library;
replacements = {
out = placeholder "out";
inherit runtimePath;
inherit (prefix) prefix library;
};
};
setupHomebrew = let
+6 -4
View File
@@ -1,6 +1,6 @@
{ lib
, pkgs
, substituteAll
, replaceVarsWith
, runtimeShell
, coreutils
, findutils
@@ -13,13 +13,15 @@
}:
let
script = substituteAll {
script = replaceVarsWith {
name = "nuke-homebrew-repository";
src = ./nuke-homebrew-repository.sh.in;
isExecutable = true;
inherit runtimeShell;
path = lib.makeBinPath [ coreutils findutils gnugrep gnused gitMinimal ];
replacements = {
inherit runtimeShell;
path = lib.makeBinPath [ coreutils findutils gnugrep gnused gitMinimal ];
};
};
brew-src = inputs.brew-src or (throw "The tests can only be run with flakes");