如何CFLAGS
在 NixOS/Nix 环境中覆盖单个包的编译标志(如 中)?
这是我现在得到的:
let
optimizeForThisHost = pkg:
pkgs.lib.overrideDerivation pkg (old: {
exportOptimizations = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC -O3 -march=native"
'';
phaseNames = ["exportOptimizations"] ++ old.phaseNames;
});
in
muttWithoutThings = pkgs: (pkgs.mutt.override {
sslSupport = false;
saslSupport = false;
imapSupport = false;
withSidebar = false;
};
});
mutt = pkgs:
(optimizeForThisHost (muttWithoutThings pkgs));
在我的configuration.nix
,虽然这失败了
error: attribute ‘phaseNames’ missing