Skip to content

Commit f99264c

Browse files
committed
modules/nixpkgs: don't assign elaborated platforms
See NixOS/nixpkgs#376988
1 parent 6288354 commit f99264c

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

modules/top-level/nixpkgs.nix

+11-10
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ in
146146
example = {
147147
system = "aarch64-linux";
148148
};
149-
apply = lib.systems.elaborate;
149+
# FIXME: An elaborated platform is not supported,
150+
# but an `apply` function is probably still needed.
151+
# See https://github.com/NixOS/nixpkgs/pull/376988
150152
defaultText = lib.literalMD ''
151153
- Inherited from the "host" configuration's `pkgs`
152154
- Or `evalNixvim`'s `system` argument
@@ -167,14 +169,9 @@ in
167169
example = {
168170
system = "x86_64-linux";
169171
};
170-
apply =
171-
value:
172-
let
173-
elaborated = lib.systems.elaborate value;
174-
in
175-
# If equivalent to `hostPlatform`, make it actually identical so that `==` can be used
176-
# See https://github.com/NixOS/nixpkgs/issues/278001
177-
if lib.systems.equals elaborated cfg.hostPlatform then cfg.hostPlatform else elaborated;
172+
# FIXME: An elaborated platform is not supported,
173+
# but an `apply` function is probably still needed.
174+
# See https://github.com/NixOS/nixpkgs/pull/376988
178175
defaultText = lib.literalMD ''
179176
Inherited from the "host" configuration's `pkgs`.
180177
Or `config.nixpkgs.hostPlatform` when building a standalone nixvim.
@@ -215,9 +212,13 @@ in
215212
inherit (cfg) config overlays;
216213
};
217214

215+
elaborated = builtins.mapAttrs (_: lib.systems.elaborate) {
216+
inherit (cfg) buildPlatform hostPlatform;
217+
};
218+
218219
# Configure `localSystem` and `crossSystem` as required
219220
systemArgs =
220-
if cfg.buildPlatform == cfg.hostPlatform then
221+
if lib.systems.equals elaborated.buildPlatform elaborated.hostPlatform then
221222
{
222223
localSystem = cfg.hostPlatform;
223224
}

wrappers/_shared.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ let
3939
# Use global packages in nixvim's submodule
4040
pkgs = lib.mkIf config.nixpkgs.useGlobalPackages (lib.mkDefault pkgs);
4141

42-
# Inherit platform spec
43-
hostPlatform = lib.mkOptionDefault pkgs.stdenv.hostPlatform;
44-
buildPlatform = lib.mkOverride buildPlatformPrio pkgs.stdenv.buildPlatform;
42+
# Inherit platforms
43+
hostPlatform = lib.mkOptionDefault pkgs.stdenv.hostPlatform.system;
44+
buildPlatform = lib.mkOverride buildPlatformPrio pkgs.stdenv.buildPlatform.system;
4545
};
4646
};
4747

0 commit comments

Comments
 (0)