From d42da140a61edde7209b87319335acbfcd84a4bd Mon Sep 17 00:00:00 2001 From: isabel Date: Fri, 9 May 2025 17:57:50 +0100 Subject: [PATCH] refactor: substituteAll -> replaceVars --- modules/default.nix | 9 ++++++--- pkgs/nuke-homebrew-repository/default.nix | 10 ++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 36b9bde..943778c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -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 diff --git a/pkgs/nuke-homebrew-repository/default.nix b/pkgs/nuke-homebrew-repository/default.nix index bfc0075..aa9d2d3 100644 --- a/pkgs/nuke-homebrew-repository/default.nix +++ b/pkgs/nuke-homebrew-repository/default.nix @@ -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");