我想使用Nixpkgs叠加层将makeFlag添加到Firefox程序包中,但这似乎并不简单。
(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
(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)
答案 0 :(得分:2)
原来,需要覆盖firefox-unwrapped
属性:
(import <nixpkgs> {
overlays = [
(self: super: {
firefox-unwrapped = super.firefox-unwrapped.overrideAttrs (oldAttrs: {
makeFlags = oldAttrs.makeFlags ++ [ "BUILD_OFFICIAL=1" ];
});
})
];
}).firefox-unwrapped
这样表达式就可以求值。