在 Nixpkgs 中覆盖 Firefox makeFlags
Override Firefox makeFlags in Nixpkgs
我想使用 Nixpkgs 覆盖向 Firefox 包添加一个 makeFlag,但这似乎很重要。
覆盖 w3m 有效...
(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
...但覆盖 Firefox 不会。
(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)
事实证明,需要覆盖 firefox-unwrapped
属性:
(import <nixpkgs> {
overlays = [
(self: super: {
firefox-unwrapped = super.firefox-unwrapped.overrideAttrs (oldAttrs: {
makeFlags = oldAttrs.makeFlags ++ [ "BUILD_OFFICIAL=1" ];
});
})
];
}).firefox-unwrapped
表达式的计算方式。
我想使用 Nixpkgs 覆盖向 Firefox 包添加一个 makeFlag,但这似乎很重要。
覆盖 w3m 有效...
(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
...但覆盖 Firefox 不会。
(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)
事实证明,需要覆盖 firefox-unwrapped
属性:
(import <nixpkgs> {
overlays = [
(self: super: {
firefox-unwrapped = super.firefox-unwrapped.overrideAttrs (oldAttrs: {
makeFlags = oldAttrs.makeFlags ++ [ "BUILD_OFFICIAL=1" ];
});
})
];
}).firefox-unwrapped
表达式的计算方式。