Perhaps a dumb question but I’m running into some problems overriding a package. For the following two files:
neovim.nix
# { neovim }:
{ pkgs ? import <nixpkgs> {} }:
pkgs.neovim-unwrapped.overrideAttrs (oldAttrs: {
NIX_CFLAGS_COMPILE = "test"; #" -O3 -march=native";
buildPhase = ''
echo "======================================"
echo $NIX_CFLAGS_COMPILE
echo "======================================"
'';
enableParallelBuilding = true;
})
builder.nix
{ 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:
- Clone nixpkgs
- nix-build builder.nix --no-out-link (Doesn’t build parallel by default)
- add “enableParallelBuilding” to pkgs/applications/editors/neovim/default.nix`
- nix-build builder.nix --no-out-link (NOW it builds in parallel, but only if edited directly not via overrideAttrs)
- REMOVE “enableParallelBuilding” from pkgs/applications/editors/neovim/default.nix`
- nix-build builder.nix --no-out-link (STILL BUILDS IN PARALLEL)
What the heck?