Make sure we can use nix cache for non-cross-compiling

This commit is contained in:
Brian Picciano 2023-03-25 16:18:52 +01:00
parent 3a3bd56295
commit 1180540ce3
3 changed files with 15 additions and 27 deletions

View File

@ -1,25 +1,6 @@
{
"nodes": {
"root": {
"inputs": {
"utils": "utils"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
"root": {}
},
"root": "root",
"version": 7

View File

@ -1,10 +1,8 @@
{
inputs.utils.url = "github:numtide/flake-utils";
description = "cryptic-net provides the foundation for an autonomous community cloud infrastructure";
outputs = {
self, utils,
self,
}: let
supportedSystems = (import ./nix/pkgs.nix).supportedSystems;

View File

@ -45,9 +45,18 @@ rec {
default = {
buildSystem,
hostSystem ? buildSystem,
}: import src {
system = buildSystem;
crossSystem.config = hostSystem;
}: import src ({
inherit overlays;
};
system = buildSystem;
} // (if buildSystem == hostSystem then {} else {
# The nixpkgs cache doesn't have any packages where cross-compiling has been
# enabled, even if the target platform is actually the same as the build
# platform (and therefore it's not really cross-compiling). So we only set
# up the cross-compiling config if the target platform is different.
crossSystem.config = hostSystem;
}));
}