1 { evalMinimalConfig, pkgs, lib, stdenv }:
3 eval = mod: evalMinimalConfig {
4 imports = [ ../nixpkgs.nix mod ];
7 nixpkgs.hostPlatform = "aarch64-linux";
9 withHostAndBuild = eval {
10 nixpkgs.hostPlatform = "aarch64-linux";
11 nixpkgs.buildPlatform = "aarch64-darwin";
14 _file = "ambiguous.nix";
15 nixpkgs.hostPlatform = "aarch64-linux";
16 nixpkgs.buildPlatform = "aarch64-darwin";
17 nixpkgs.system = "x86_64-linux";
18 nixpkgs.localSystem.system = "x86_64-darwin";
19 nixpkgs.crossSystem.system = "i686-linux";
21 { _file = "repeat.nix";
22 nixpkgs.hostPlatform = "aarch64-linux";
28 uncheckedEval = lib.evalModules { modules = [ ../nixpkgs.nix module ]; };
29 in map (ass: ass.message) (lib.filter (ass: !ass.assertion) uncheckedEval.config.assertions);
31 lib.recurseIntoAttrs {
34 nixpkgs.system = stdenv.hostPlatform.system;
35 })._module.args.pkgs.hello;
37 assert withHost._module.args.pkgs.stdenv.hostPlatform.system == "aarch64-linux";
38 assert withHost._module.args.pkgs.stdenv.buildPlatform.system == "aarch64-linux";
39 assert withHostAndBuild._module.args.pkgs.stdenv.hostPlatform.system == "aarch64-linux";
40 assert withHostAndBuild._module.args.pkgs.stdenv.buildPlatform.system == "aarch64-darwin";
41 assert builtins.trace (lib.head (getErrors ambiguous))
42 getErrors ambiguous ==
44 Your system configures nixpkgs with the platform parameters:
45 nixpkgs.hostPlatform, with values defined in:
48 nixpkgs.buildPlatform, with values defined in:
51 However, it also defines the legacy options:
52 nixpkgs.system, with values defined in:
54 nixpkgs.localSystem, with values defined in:
56 nixpkgs.crossSystem, with values defined in:
59 For a future proof system configuration, we recommend to remove
60 the legacy definitions.
63 nixpkgs.localSystem = pkgs.stdenv.hostPlatform;
64 nixpkgs.hostPlatform = pkgs.stdenv.hostPlatform;