See https://zimbatm.com/notes/1000-instances-of-nixpkgs and https://discourse.nixos.org/t/1000-instances-of-nixpkgs/17347
https://github.com/fufexan/nix-gaming/blob/master/pkgs/default.nix#L16-L19
If you want to do this, please consider using https://github.com/numtide/nixpkgs-unfree instead of instantiating a new pkgs instance. Give https://github.com/numtide/nixpkgs-unfree/tree/main?tab=readme-ov-file#flake-usage a read. You can allow it to have nixpkgs.follows from another nixpkgs instance, allowing the user to choose the ref of nixpkgs without disabling the capacity for unfree software, while allowing for a reduction in evaluation time and memory usage.
See https://zimbatm.com/notes/1000-instances-of-nixpkgs and https://discourse.nixos.org/t/1000-instances-of-nixpkgs/17347
https://github.com/fufexan/nix-gaming/blob/master/pkgs/default.nix#L16-L19
If you want to do this, please consider using https://github.com/numtide/nixpkgs-unfree instead of instantiating a new pkgs instance. Give https://github.com/numtide/nixpkgs-unfree/tree/main?tab=readme-ov-file#flake-usage a read. You can allow it to have nixpkgs.follows from another nixpkgs instance, allowing the user to choose the ref of nixpkgs without disabling the capacity for unfree software, while allowing for a reduction in evaluation time and memory usage.