How to fix `evaluation warning: 'system' has been renamed to/replaced by 'stdenv.hostPlatform.system'`

This is an antipattern anyway. It should be replaced.

Also an antipattern. In NixOS config users should be setting nixpkgs.hostPlatform. No it’s not going to fix this warning, but the underlying reasoning is the same: system does not specify the platform explicitly enough, and passing system to lib.nixosSystem has long been deprecated for the same reason.

I expect a warning to eventually come for this antipattern too.

I think you mean --option abort-on-warn true --show-trace and tbh it did not work for me.

What did work for me is prefixing the command with NIX_ABORT_ON_WARN=1 and using --impure if building with flakes (to ensure the envvar is picked up).

EDIT: I’ve figured out why - lix does not have a builtins.warn since it was only added in nix 2.23 and lix branched off at 2.18. Hence my advice is compatible with more nix versions.

TLDR use NIX_ABORT_ON_WARN=1 not the abort-on-warn option.

8 Likes