nix-community / bundix

Generates a Nix expression for your Bundler-managed application. [maintainer=@manveru]
160 stars 54 forks source link

Feature request: The gemset path should be allowed to be arbitray #110

Open 573 opened 9 months ago

573 commented 9 months ago

The gemset attribute of bundlerEnv should be allowed to point to an arbitrary path.

Incomplete working example using flakes:

cat flake/builders/mkDevenvRuby.nix
{ system, rootPath, pkgsFor, inputs, name, args, ... }:

let
  pkgs = pkgsFor.${system};

        ruby = inputs.nixpkgs-ruby.lib.packageFromRubyVersionFile {
          file = "${rootPath}/home/misc/.ruby-version";
          inherit system;
        };

        gems = pkgs.bundlerEnv {
          name = "gemset";
          inherit ruby;
          gemfile = "${rootPath}/home/misc/Gemfile";
          lockfile = "${rootPath}/home/misc/Gemfile.lock";
      # TODO Find out, why moving the generated gemset.nix to some other folder does not work
          gemset = "${rootPath}/flake/builders/gemset.nix";
          groups = [ "default" "production" "development" "test" ];
        };
      in
          pkgs.mkShell {
            buildInputs = [
              gems
              ruby
              pkgs.bundix
            ];
          }

When using "gemset = ${rootPath}/home/misc/gemset.nix"; instead this expression currently gives me:

 error: The option `gmail-britta' does not exist. Definition values:
       - In `/nix/store/z5l6xz6cpi8lcx1sjisaqvlav9rf784s-source/home/misc/gemset.nix':
           {
             dependencies = [
               "haml"
             ];
             groups = [
           ...