Can not install unfree package from remote flake repository

I’m trying to install an unfree package from a remote flake repository, this is my flake configuration However, when I’m trying to install a unfree package from a flake input, it show the error in the picture. I’ve add nixpkgs.config.allowUnfree in my configuration.nix and I can:

  1. install unfree package from envrionment.systemPackages.,
  2. install unfree package with home.packages = [ pkgs.someunfreepackage ].,
  3. install unfree package from flake input if I download the package.nix manually and use home.packages = [ (pkgs.callPackage ./pacakge {}) ],

I can not install a package like this home.packages = [ inputs.someguy.packages.${pkgs.system}.someunfreepackage ] Your time and help is greatly appreciated.


Yep so, that’s impossible with flakes.

Ask upstream if they can provide an overlay which you can use in your config, which will use your nixpkgs instance that’s configured to allow unfree packages. In the meantime, you could use something like

(pkgs.callPackage "${inputs.whatever}/path/to/package_expression.nix" {})

There are other options but even more hackish IMO…

Hmm, I think using nixpkgs-unfree is a relatively clean solution.

Something like:

inputs = {
  nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
  nixpkgs-unfree = {
    url = "github:numtide/nixpkgs-unfree";
    inputs.nixpkgs.follows = "nixpkgs";
  }
  eidoid = {
    url = "github:eidoid/flakes";
    inputs.nixpkgs.follows = "nixpkgs-unfree";
  };
}

Definitely a bit of a hack, but serviceable until flakes actually become featureful enough for use on NixOS.

Could you give me more detail about the overlay thing please? Because I think the upstream (which is me) don’t know how.

Sadly this method gives me the same error for some reason.