From e88b940e4ca15127991eb8095c56db40a55e457f Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Mon, 27 May 2024 13:30:45 -0600 Subject: [PATCH] Pin to Ruby 3.3 We are using their bundled gems and this can be extremely fragile :/ --- modules/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 8aad1cf..7ce6d4e 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -35,6 +35,7 @@ let tools = pkgs.callPackage ../pkgs { }; brew = if cfg.patchBrew then patchBrew cfg.package else cfg.package; + ruby = pkgs.ruby_3_3; # Sadly, we cannot replace coreutils since the GNU implementations # behave differently. @@ -285,9 +286,7 @@ let /bin/ln -shf "${env}" "$HOMEBREW_LIBRARY/Taps" ''; - patchBrew = brew: let - pinnedRuby = "${pkgs.ruby}/bin/ruby"; - in pkgs.runCommandLocal "${brew.name or "brew"}-patched" {} ('' + patchBrew = brew: pkgs.runCommandLocal "${brew.name or "brew"}-patched" {} ('' cp -r "${brew}" "$out" chmod u+w "$out" "$out/Library/Homebrew/cmd" @@ -299,7 +298,7 @@ let ruby_sh="$out/Library/Homebrew/utils/ruby.sh" if [[ -e "$ruby_sh" ]] && grep "setup-ruby-path" "$ruby_sh"; then chmod u+w "$ruby_sh" - echo -e "setup-ruby-path() { export HOMEBREW_RUBY_PATH=\"${pinnedRuby}\"; }" >>"$ruby_sh" + echo -e "setup-ruby-path() { export HOMEBREW_RUBY_PATH=\"${ruby}/bin/ruby\"; }" >>"$ruby_sh" fi '' + lib.optionalString (brew ? version) '' # Embed version number instead of checking with git