overrideAttrs has no effect?

Perhaps a dumb question but I’m running into some problems overriding a package. For the following two files:


# { neovim }:
{ pkgs ? import <nixpkgs> {} }:

pkgs.neovim-unwrapped.overrideAttrs (oldAttrs: {
  NIX_CFLAGS_COMPILE = "test"; #" -O3 -march=native";
  buildPhase = ''
    echo "======================================"
    echo "======================================"
  enableParallelBuilding = true;


{ pkgs ? import <nixpkgs> {}}:
pkgs.callPackage ./neovim.nix {}

My overrides have no effect when calling nix-build --no-out-link builder.nix while if I clone nixpkgs and edit “pkgs/applications/editors/neovim/default.nix” directly I am able to (obviously) modify the derivtion. Any ideas?

EDIT: So I was partially mistaken, it appears overriding buildPhase and NIX_CFLAGS_COMPILE DOES have an effect, but not enableParallelBuilding.

What’s even weird is:

  1. Clone nixpkgs
  2. nix-build builder.nix --no-out-link (Doesn’t build parallel by default)
  3. add “enableParallelBuilding” to pkgs/applications/editors/neovim/default.nix`
  4. nix-build builder.nix --no-out-link (NOW it builds in parallel, but only if edited directly not via overrideAttrs)
  5. REMOVE “enableParallelBuilding” from pkgs/applications/editors/neovim/default.nix`
  6. nix-build builder.nix --no-out-link (STILL BUILDS IN PARALLEL)

What the heck?

Were you ever able to figure this one out? I have the same issue, but when I’m trying to override the source.

For the original issue, the derivation already used cmake then, which enables parallel building by default. So adding extra enableParallelBuilding = true; will have no effect, since it is already enabled.

Could you describe in more detail what have you tried?