How to show all the required `allowUnfreePredicate` at once?

I don’t want to use nixpkgs.config.allowUnfree = true; because I want to keep track every unfree packages on my system, so i use

nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "unfreelistitem" ];

instead.

However, cuda contain a lot of unfree packages, something like

[
  "cuda-merged"
  "cuda_cuobjdump"
  "cuda_gdb"
  "cuda_nvdisasm"
  "cuda_nvcc"
  "cuda_cccl"
  "cuda_cudart"
   #...
]

so when everytime I run nixos-rebuild switch, it only prompt one of it in the error message, which is very time consuming for me to add them in the list.
How can I get all of it at once? Thanks!

1 Like

I think --keep-going will try (and fail) to build them all before quitting?

--keep-going is for builds, I don’t know of a method to power through eval errors.

Try evaluating with GitHub - nix-community/nix-eval-jobs: Parallel nix evaluator with a streamable json output [maintainers @Mic92, @adisbladis]

iirc that just shows the same errors $JOBS times, it doesn’t actually parallelise eval.

Well, then in general you could write your own code to recurse through the cuda subtree and find the relevant package names.

But for Cuda you can also use nixpkgs/pkgs/development/cuda-modules/_cuda/lib/cuda.nix at 1a133b4464859f6e8fe2c9b2f72d52fcb3ffe3b5 · NixOS/nixpkgs · GitHub