From 197e82f0500c63b5fd709e177d623dccf0d2d2de Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 9 Apr 2023 18:33:06 -0700 Subject: [PATCH] src/platforms/common: factor out {amd,arm}64.nix This commit creates a (currently empty) overlay list for things common to each of the amd64 and arm64 platform-classes. --- src/default.nix | 9 ++++++--- src/platform/am1i/default.nix | 3 ++- src/platform/common/amd64.nix | 7 +++++++ src/platform/common/arm64.nix | 7 +++++++ src/platform/kevin/default.nix | 3 ++- src/platform/kgpe/default.nix | 3 ++- 6 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/platform/common/amd64.nix create mode 100644 src/platform/common/arm64.nix diff --git a/src/default.nix b/src/default.nix index 762356d..e7e61e3 100644 --- a/src/default.nix +++ b/src/default.nix @@ -31,11 +31,14 @@ let (self: { inherit lib nixpkgsOnBuildForBuild; })).overrideScope' (lib.foldl' lib.composeExtensions (_: prev: prev) ([base] ++ overlays)); + common_amd64 = import ./platform/common/amd64.nix { inherit lib; }; + common_arm64 = import ./platform/common/arm64.nix { inherit lib; }; + in { # one entry for each supported platform - kevin = ownerboot (import ./platform/kevin { inherit lib; }); - am1i = ownerboot (import ./platform/am1i { inherit lib; }); - kgpe = ownerboot (import ./platform/kgpe { inherit lib; }); + kevin = ownerboot (import ./platform/kevin { inherit lib common_arm64; }); + am1i = ownerboot (import ./platform/am1i { inherit lib common_amd64; }); + kgpe = ownerboot (import ./platform/kgpe { inherit lib common_amd64; }); em100 = nixpkgsOnBuildForBuild.callPackage ./util/em100 { }; } diff --git a/src/platform/am1i/default.nix b/src/platform/am1i/default.nix index bb1478c..4414608 100644 --- a/src/platform/am1i/default.nix +++ b/src/platform/am1i/default.nix @@ -1,10 +1,11 @@ { lib ? import , hostPlatform ? lib.systems.examples.gnu64 +, common_amd64 }: { inherit hostPlatform; - overlays = [(final: prev: { + overlays = common_amd64.overlays ++ [(final: prev: { platform_name = "am1i"; diff --git a/src/platform/common/amd64.nix b/src/platform/common/amd64.nix new file mode 100644 index 0000000..a6fac26 --- /dev/null +++ b/src/platform/common/amd64.nix @@ -0,0 +1,7 @@ +{ lib ? import +}: + +{ + overlays = [( final: prev: { + })]; +} diff --git a/src/platform/common/arm64.nix b/src/platform/common/arm64.nix new file mode 100644 index 0000000..c512951 --- /dev/null +++ b/src/platform/common/arm64.nix @@ -0,0 +1,7 @@ +{ lib ? import +}: + +{ + overlays = [(final: prev: { + })]; +} diff --git a/src/platform/kevin/default.nix b/src/platform/kevin/default.nix index b5d05e6..76ad720 100644 --- a/src/platform/kevin/default.nix +++ b/src/platform/kevin/default.nix @@ -1,5 +1,6 @@ { lib ? import , hostPlatform ? lib.systems.examples.aarch64-multiplatform +, common_arm64 }: let # order matters! this is also the order in which the modules are insmoded @@ -36,7 +37,7 @@ let in { inherit hostPlatform; - overlays = [(final: prev: { + overlays = common_arm64.overlays ++ [(final: prev: { nixpkgsOnBuildForHost = prev.nixpkgsOnBuildForBuild.pkgsCross.aarch64-multiplatform; platform_name = "kevin"; diff --git a/src/platform/kgpe/default.nix b/src/platform/kgpe/default.nix index 0b47683..1184c87 100644 --- a/src/platform/kgpe/default.nix +++ b/src/platform/kgpe/default.nix @@ -1,11 +1,12 @@ { lib ? import , hostPlatform ? lib.systems.examples.gnu64 +, common_amd64 }: { inherit hostPlatform; - overlays = [(final: prev: { + overlays = common_amd64.overlays ++ [(final: prev: { platform_name = "kgpe";