1

I want to add a makeFlag to the Firefox package using Nixpkgs overlays, but it seems to be non-trivial.

Overriding w3m works...

(import <nixpkgs> {
  overlays = [
    (self: super: {
      w3m = super.w3m.overrideAttrs (oldAttrs: {
        # that makeFlag makes no sense for w3m, it's just for demonstration
        makeFlags = oldAttrs.makeFlags ++ [ "BUILD_OFFICIAL=1" ];
      });
    })
  ];
}).w3m

...but overriding Firefox doesn't.

(import <nixpkgs> {
  overlays = [
    (self: super: {
      firefox = super.firefox.overrideAttrs (oldAttrs: {
        makeFlags = oldAttrs.makeFlags ++ [ "BUILD_OFFICIAL=1" ];
      });
    })
  ];
}).firefox
$ nix build -f default.nix
error: attribute 'makeFlags' missing, at /path/to/default.nix:5:21
(use '--show-trace' to show detailed location information)
erictapen
  • 425
  • 2
  • 11

1 Answers1

2

It turned out, that one needs to override the firefox-unwrapped attribute:

(import <nixpkgs> {
  overlays = [
    (self: super: {
      firefox-unwrapped = super.firefox-unwrapped.overrideAttrs (oldAttrs: {
        makeFlags = oldAttrs.makeFlags ++ [ "BUILD_OFFICIAL=1" ];
      });
    })
  ];
}).firefox-unwrapped

That way the expression evaluates.

erictapen
  • 425
  • 2
  • 11