Skip to content

Commit

Permalink
ci.nix: make isBuildable work when p.meta.license is a list
Browse files Browse the repository at this point in the history
Currently when `p.meta.license` is a list, `ci.nix` falls back to its
default value of `true` (it's not an attrset, so it can't have a
`.free` attribute). If that list contains an unfree license, the
actions can end up trying to build the package, and getting an error
because `allowUnfree` isn't set.
  • Loading branch information
Rhys-T committed Sep 22, 2024
1 parent 9e4f851 commit 67153f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ with builtins;
let
isReserved = n: n == "lib" || n == "overlays" || n == "modules";
isDerivation = p: isAttrs p && p ? type && p.type == "derivation";
isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true;
isBuildable = p: let
licenseFromMeta = p.meta.license or [];
licenseList = if builtins.isList licenseFromMeta then licenseFromMeta else [licenseFromMeta];
in !(p.meta.broken or false) && builtins.all (license: license.free or true) licenseList;
isCacheable = p: !(p.preferLocalBuild or false);
shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false;

Expand Down

0 comments on commit 67153f7

Please sign in to comment.