How do I apply a GitHub commit to my configuration.nix?

All you are doing here is adding a checkout of that config as a package named pr176561. That doesn’t affect your configuration at all. However the same import statement at nixpkgs.pkgs would work.

Setting { config = config.nixpkgs.config; } there may actually lead to infinite recursion. If it does, simply define your desired nixpkgs config inline.

If you would rather not override your entire configurations nixpkgs, but instead just use this one changed module, you could leave it the way it is and instead disable the module from your configuration’s nixpkgs, and import it from your pr176561 package like so:

{pkgs, ...}: {
  disabledModules = [ "services/desktops/pipewire/pipewire.nix" ];
  imports = [ "${pkgs.pr176561}/nixos/modules/services/desktops/pipewire/pipewire.nix" ];
}

You could even use GitHub’s raw api to fetch just the module file itself, to avoid the large fetch and extra evaluation cost.

On an unrelated note, using packageOverrides directly has been discouraged for a while. Probably better to use overlays, or as some would suggest, just define your custom packages and/or overrides at the call-site.

1 Like