flake.nix: fix for better caching on non-cross builds

This commit is contained in:
Colin 2023-12-11 21:24:33 +00:00
parent 4a622c558e
commit e7edb4739f
1 changed files with 6 additions and 2 deletions

View File

@ -111,13 +111,17 @@
nixpkgsCompiledBy = system: nixpkgs.legacyPackages."${system}";
evalHost = { name, local, target, light ? false }: nixpkgs.lib.nixosSystem {
# system = target;
system = target;
modules = [
{
nixpkgs.buildPlatform.system = local;
nixpkgs.hostPlatform.system = target;
# nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv;
}
(optionalAttrs (local != target) {
# XXX(2023/12/11): cache.nixos.org uses `system = ...` instead of `hostPlatform.system`, and that choice impacts the closure of every package.
# so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches.
nixpkgs.hostPlatform.system = target;
})
(optionalAttrs light {
sane.enableSlowPrograms = false;
})