From 83a2d993d401a65d98784df5cc9fb1ea72e2f2a2 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 11 Dec 2018 21:19:32 +0000 Subject: [PATCH] bundlerEnv: include all groups by default This wasn't really an issue until the latest minor release of Bundix (2.4), because prior to then Bundix didn't emit group attributes, and so this functionality of bundlerEnv wasn't really used. However, it is now apparent that a better default for bundlerEnv would be to include all gem groups by default, not just the default group. This matches the behavior of Bundler, and makes more sense, because the default group alone isn't necessarily useful for anything -- consider a Rails app with production, development, and test groups. It has the additional benefit of being backwards compatible with how this would have worked before the Bundix update. --- .../ruby-modules/bundled-common/default.nix | 2 +- .../ruby-modules/bundled-common/functions.nix | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix index 1b64456fb20..c31dfb63b3c 100644 --- a/pkgs/development/ruby-modules/bundled-common/default.nix +++ b/pkgs/development/ruby-modules/bundled-common/default.nix @@ -17,7 +17,7 @@ , postBuild ? null , document ? [] , meta ? {} -, groups ? ["default"] +, groups ? null , ignoreCollisions ? false , buildInputs ? [] , ... diff --git a/pkgs/development/ruby-modules/bundled-common/functions.nix b/pkgs/development/ruby-modules/bundled-common/functions.nix index 81e2fa35329..f477b2bee7c 100644 --- a/pkgs/development/ruby-modules/bundled-common/functions.nix +++ b/pkgs/development/ruby-modules/bundled-common/functions.nix @@ -1,7 +1,8 @@ { lib, gemConfig, ... }: let - inherit (lib) attrValues concatMap converge filterAttrs getAttrs; + inherit (lib) attrValues concatMap converge filterAttrs getAttrs + intersectLists; in rec { bundlerFiles = { @@ -49,10 +50,9 @@ in rec { ) attrs.platforms ); - groupMatches = groups: attrs: ( - !(attrs ? "groups") || - builtins.any (gemGroup: builtins.any (group: group == gemGroup) groups) attrs.groups - ); + groupMatches = groups: attrs: + groups == null || !(attrs ? "groups") || + (intersectLists groups attrs.groups) != []; applyGemConfigs = attrs: (if gemConfig ? "${attrs.gemName}"