From 3bdbd9db7b7960e94858f60688e57fc4e909424b Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 11 May 2023 22:39:08 +0000 Subject: [PATCH] `nixpkgs.hostPlatform`: set as default, to allow hosts to customize it later --- flake.nix | 6 ++++-- hosts/instantiate.nix | 12 +----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index 581c607c..a6bfa31d 100644 --- a/flake.nix +++ b/flake.nix @@ -116,10 +116,12 @@ self.overlays.pkgs # self.overlays.optimizations ]; - nixpkgs.hostPlatform = target; + } + ({ lib, ... }: { + nixpkgs.hostPlatform = lib.mkDefault target; # nixpkgs.buildPlatform = local; # set by instantiate.nix instead # nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv; - } + }) ]; }); in { diff --git a/hosts/instantiate.nix b/hosts/instantiate.nix index 1f5f445a..f823df25 100644 --- a/hosts/instantiate.nix +++ b/hosts/instantiate.nix @@ -4,7 +4,7 @@ { hostName, localSystem }: # module args -{ config, lib, ... }: +{ lib, ... }: { imports = [ @@ -16,14 +16,4 @@ networking.hostName = hostName; nixpkgs.buildPlatform = lib.mkIf (localSystem != null) localSystem; sane.cross.enablePatches = localSystem != null; - - # nixpkgs.overlays = [ - # (next: prev: { - # # for local != target we by default just emulate the target while building. - # # provide a `pkgs.cross.` alias that consumers can use instead of `pkgs.` - # # to explicitly opt into non-emulated cross compilation for any specific package. - # # this is most beneficial for large packages with few pre-requisites -- like Linux. - # cross = prev.crossFrom."${localSystem}"; - # }) - # ]; }