fix: use localSystem over builtins.currentSystem where appropriate

cl/5832 added a global system parameter to depot which allowed specifying
what `system` should be used for nixpkgs and all depot derivations
(assuming a native compilation case) which was implemented in cl/5846.
This allows instantiating derivations for a different system than
whatever builtins.currentSystem happens to be. This is useful for
debugging, allows you to schedule builds on build servers for
other platforms or build for architectures that are a subset of
the one you are running (e.g. i686-linux).

This change eliminates all remaining uses of builtins.currentSystem
which could lead to an inconsistent combination of `system` values
when passing `localSystem`.

Change-Id: I0f824f4f0afa88ef1ddd9a8cecb24bf94bacde7a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7260
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: sterni <sternenseemann@systemli.org>
This commit is contained in:
sterni 2022-11-10 14:18:59 +01:00 committed by clbot
parent dde62055fe
commit 350d60ea8e
2 changed files with 5 additions and 5 deletions

View file

@ -12,7 +12,7 @@
# other folders below //third_party, other than the ones mentioned # other folders below //third_party, other than the ones mentioned
# above. # above.
{ pkgs, depot, ... }: { pkgs, depot, localSystem, ... }:
{ {
# Expose a partially applied NixOS, expecting an attribute set with # Expose a partially applied NixOS, expecting an attribute set with
@ -27,7 +27,7 @@
nixos = nixos =
{ configuration { configuration
, specialArgs ? { } , specialArgs ? { }
, system ? builtins.currentSystem , system ? localSystem
, ... , ...
}: }:
let let

View file

@ -1,6 +1,6 @@
# This overlay is used to make TVL-specific modifications in the # This overlay is used to make TVL-specific modifications in the
# nixpkgs tree, where required. # nixpkgs tree, where required.
{ depot, ... }: { depot, localSystem, ... }:
self: super: self: super:
let let
@ -30,8 +30,8 @@ in
nix = (import "${nixSrc}/release.nix" { nix = (import "${nixSrc}/release.nix" {
nix = nixSrc; nix = nixSrc;
nixpkgs = super.path; nixpkgs = super.path;
systems = [ builtins.currentSystem ]; systems = [ localSystem ];
}).build."${builtins.currentSystem}"; }).build."${localSystem}";
nix_latest = super.nix; nix_latest = super.nix;