Skip to content

Commit

Permalink
nixos/nixpkgs: deprecate == support for hostPlatform & `buildPlat…
Browse files Browse the repository at this point in the history
…form`
  • Loading branch information
MattSturgeon committed Feb 8, 2025
1 parent 254a289 commit 074172f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion nixos/modules/misc/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,16 @@ in
elaborated = lib.systems.elaborate inputBuildPlatform;
in
if lib.systems.equals elaborated cfg.hostPlatform then
cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001
# Make equivalent platforms actually identical,
# so that `==` equality works.
# See https://github.com/NixOS/nixpkgs/issues/278001
# NOTE: `==` between platforms was deprecated 2025-02-08.
# Users should instead use the `canExecute`, `equals`, or `notEquals`
# functions included with platform attrsets or use `lib.systems.equals`.
# See https://github.com/NixOS/nixpkgs/pull/380005
# TODO: Once users have had chance to migrate, this `apply` function
# can be simplified to `lib.systems.elaborate`.
cfg.hostPlatform
else
elaborated;
defaultText = lib.literalExpression ''config.nixpkgs.hostPlatform'';
Expand Down

0 comments on commit 074172f

Please sign in to comment.