erictapen
erictapen

Reputation: 598

Override Firefox makeFlags in Nixpkgs

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)

Upvotes: 2

Views: 721

Answers (1)

erictapen
erictapen

Reputation: 598

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.

Upvotes: 3

Related Questions