Skip to content

Commit

Permalink
Only apply overlay on nix if is not cached platform
Browse files Browse the repository at this point in the history
  • Loading branch information
IonAgorria committed Sep 12, 2023
1 parent 0dc978d commit fff23d8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
outputs = { self, nixpkgs, ... }:
let
# Systems supported to build this package
buildSystems = with nixpkgs.lib.platforms; [
buildSystems = [
"i686-linux"
"x86_64-linux"
"x86_64-darwin"
Expand All @@ -24,6 +24,11 @@
"powerpc64le-linux"
#"riscv64-linux"
];

#Systems that don't need overlay
stableSystems = [
"x86_64-linux"
];

# Systems targetted for this package
crossSystems = (map (system: { name = system; inherit system; } ) buildSystems) ++ [
Expand Down Expand Up @@ -100,7 +105,7 @@
];

#Overlays to apply
overlays = [
overlays = [
#Allow all platforms for these pkgs
(self: super: (
nixpkgs.lib.genAttrs [ "SDL2_mixer" "SDL2_image" "SDL2_net" ] (name:
Expand Down Expand Up @@ -218,14 +223,14 @@
mkPerimeterPackages {
pkgs = import nixpkgs {
inherit system;
inherit overlays;
overlays = if (builtins.elem system stableSystems) then [] else overlays;
};
} ++ (builtins.concatLists (map ({ name, system }:
let
target_pkgs = import nixpkgs {
inherit localSystem;
crossSystem = system;
inherit overlays;
overlays = if (builtins.elem system stableSystems) then [] else overlays;
};
validPlatform = !target_pkgs.stdenv.hostPlatform.isDarwin
|| (
Expand Down

0 comments on commit fff23d8

Please sign in to comment.