Functions reference The nixpkgs repository has several utility functions to manipulate Nix expressions.
pkgs.overridePackages This function inside the nixpkgs expression (pkgs) can be used to override the set of packages itself. Warning: this function is expensive and must not be used from within the nixpkgs repository. Example usage: let pkgs = import <nixpkgs> {}; newpkgs = pkgs.overridePackages (self: super: { foo = super.foo.override { ... }; }; in ... The resulting newpkgs will have the new foo expression, and all other expressions depending on foo will also use the new foo expression. The behavior of this function is similar to config.packageOverrides. The self parameter refers to the final package set with the applied overrides. Using this parameter may lead to infinite recursion if not used consciously. The super parameter refers to the old package set. It's equivalent to pkgs in the above example.