From: Alexis Williams Date: Sun, 1 Feb 2026 20:10:48 +0000 (-0800) Subject: nix: fix allowUnfreePredicate for packages with multiple licenses (#19237) X-Git-Tag: upstream/0.0.8067~166 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=8a98ba4582ea961f06d350e60cf3572015489745;p=pkg%2Fggml%2Fsources%2Fllama.cpp nix: fix allowUnfreePredicate for packages with multiple licenses (#19237) The allowUnfreePredicate in pkgsCuda was wrapping p.meta.license in a list unconditionally. This fails when meta.license is already a list of licenses, as it creates a nested list and then tries to access .free and .shortName on the inner list. Use lib.toList instead, which correctly handles both cases: - Single license attrset -> wraps in list - List of licenses -> returns unchanged --- diff --git a/.devops/nix/nixpkgs-instances.nix b/.devops/nix/nixpkgs-instances.nix index 90d683a71..40cf58f19 100644 --- a/.devops/nix/nixpkgs-instances.nix +++ b/.devops/nix/nixpkgs-instances.nix @@ -4,7 +4,7 @@ # the module `{ pkgs ... }: { /* config */ }` implicitly uses # `_module.args.pkgs` (defined in this case by flake-parts). perSystem = - { system, ... }: + { lib, system, ... }: { _module.args = { # Note: bringing up https://zimbatm.com/notes/1000-instances-of-nixpkgs @@ -33,7 +33,7 @@ "CUDA EULA" "cuDNN EULA" ] - ) (p.meta.licenses or [ p.meta.license ]); + ) (p.meta.licenses or (lib.toList p.meta.license)); }; # Ensure dependencies use ROCm consistently pkgsRocm = import inputs.nixpkgs {