Override allowUnfree configuration in home-manager

Hi all, I’m managing my system with a flake (flake.nix) and installing packages and applications for the user with home-manager, installed as standalone (home.nix). I would like to override the allowUnfree configuration, only for specific applications (in particular, just for Steam at the moment) and I’d like to do it only in home.nix. Is there a way to do this? I looked around and the closest solution I found is to whitelist specific applications system-wide.

The ideal solution would be something like this (pseudocode):

# home.nix
...
home.packages = [
# free package list here
];
somethingToOverrideConfig = [
# unfree package list here
];
...

I only use unfree software in the context of gaming, so the ultimate goal is to have only a single module where unfree is allowed. I still haven’t wrapped my head around modules, so for now it would be fine to have it in the home-manager flake, but only there.

I’m aware of these resources and tried to look here on discourse, but could still not find exactly what I’d like to do:
https://nixos.wiki/wiki/Unfree_Software

Thanks in advance.

You can use nixpkgs.config:

# home.nix
{
  nixpkgs.config.allowUnfreePredicate = pkg:
    builtins.elem (pkgs.lib.getName pkg) [
      "steam"
      "steam-run"
      "steam-original"
    ];
}

Be aware the useGlobalPkgs NixOS option disables this (if you use the NixOS module rather than a standalone install).