Open drzln opened 2 years ago
It looks like bundix
pulls bundler
from nixpkgs (https://github.com/nix-community/bundix/blob/master/default.nix#L23), which is currently v2.3.9
.
If there's a way to override that, you might be able to replace that with bundler v1.17.3
I was able to hack around this by checking out the bundix repo, replacing the bundler reference with an old version from nix, building it, and using the executable in my project.
Here's the changes I made to bundix
:
diff --git a/default.nix b/default.nix
index f72ea93..6f664e9 100644
--- a/default.nix
+++ b/default.nix
@@ -1,10 +1,18 @@
{
pkgs ? (import <nixpkgs> {}),
- ruby ? pkgs.ruby_2_6,
+ ruby ? pkgs.ruby_2_7,
bundler ? (pkgs.bundler.override { inherit ruby; }),
nix ? pkgs.nix,
nix-prefetch-git ? pkgs.nix-prefetch-git,
}:
+let
+ old_nixpkgs = import (
+ builtins.fetchTarball {
+ url = "https://github.com/nixos/nixpkgs/archive/96a1dbac972c4f67aea7ee548f4e5531003f8ab0.tar.gz";
+ sha256 = "0mx335ym9ai3ci3dgwszk289xjpvsqf6xx6g43250y5zwz9692mz";
+ }
+ ) {};
+in
pkgs.stdenv.mkDerivation rec {
version = "2.5.0";
name = "bundix";
@@ -20,7 +28,7 @@ pkgs.stdenv.mkDerivation rec {
'';
nativeBuildInputs = [ pkgs.makeWrapper ];
- buildInputs = [ ruby bundler ];
+ buildInputs = [ ruby old_nixpkgs.bundler ];
meta = {
inherit version;
and then after that, I ran nix-build .
, and then I had a bundix executable in result/bin/bundix
which had bundler v1.17.3
.
You can check out the history of bundler on nixpkgs here to find other commit shas with different versions: https://github.com/NixOS/nixpkgs/commits/350fd0044447ae8712392c6b212a18bdf2433e71/pkgs/development/ruby-modules/bundler
Someone with more nix experience than me could probably come up with a better solution, maybe there's a way you can override bundix's bundler version from just a reference to the derivation?
In case it helps anyone, here’s how I did it:
let
bundler_1_17_3 = (import (pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "fcc8660d359d2c582b0b148739a72cec476cfef5";
hash = "sha256-eZhUhVwSWkLqhmbOoBDd26J42CeyhMcYxXRqjGuVXFs=";
}) { }).bundler;
bundix = pkgs.bundix.override {
bundler = bundler_1_17_3.override {
ruby = pkgs.ruby_2_7;
};
};
in
pkgs.mkShell {
buildInputs = [ bundix ];
}
Nix Package Versions is useful for finding the old revision.
Hello,
It would seem that bundix is unhappy with the bundler read in the Gemfile. My understanding is bundix should be an isolated binary with all its necessary dependencies with it.