fix overlay application order so `cross` comes before `pkgs`

this lets me add new packages, and have them be emulated on moby builds
This commit is contained in:
Colin 2023-05-24 03:57:35 +00:00
parent b2fe449c7f
commit 9b2b261bd3
8 changed files with 1189 additions and 1489 deletions

View File

@ -102,11 +102,8 @@
self.nixosModules.passthru
{
nixpkgs.overlays = [
self.overlays.disable-flakey-tests
self.overlays.passthru
self.overlays.pins
self.overlays.pkgs
# self.overlays.optimizations
self.overlays.sane-all
];
}
({ lib, ... }: {
@ -175,6 +172,7 @@
# N.B.: `nix flake check` requires every overlay to take `final: prev:` at defn site,
# hence the weird redundancy.
default = final: prev: self.overlays.pkgs final prev;
sane-all = final: prev: import ./overlays/all.nix final prev;
disable-flakey-tests = final: prev: import ./overlays/disable-flakey-tests.nix final prev;
pkgs = final: prev: import ./overlays/pkgs.nix final prev;
pins = final: prev: import ./overlays/pins.nix final prev;

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
{ lib, pkgs, ... }:
{
imports = [
./cross
./feeds.nix
./fs.nix
./hardware.nix

View File

@ -15,5 +15,4 @@
networking.hostName = hostName;
nixpkgs.buildPlatform = lib.mkIf (localSystem != null) localSystem;
sane.cross.enablePatches = localSystem != null;
}

View File

@ -124,17 +124,22 @@ in [
hash = "sha256-+g3XhmBt/udhbBDiVyfWnfXKvZTvDurlvPblQ9HYp3s=";
})
(fetchpatch' {
# harec: support pkgsCross cross-compilation
saneCommit = "6f77961e94fe736b2f9963dd9c6411b36f8bb9c5";
hash = "sha256-3QmV7ihPBEdLDGfJQBN+J/A3DpzpGFjzggsXLbr3hOE=";
})
# (fetchpatch' {
# # harec: support pkgsCross cross-compilation
# saneCommit = "6f77961e94fe736b2f9963dd9c6411b36f8bb9c5";
# hash = "sha256-3QmV7ihPBEdLDGfJQBN+J/A3DpzpGFjzggsXLbr3hOE=";
# })
(fetchpatch' {
# hare: unstable-2023-03-15 -> unstable-2023-04-23
# TODO: remove aarch64 block & then ship upstream
saneCommit = "ef2a506dac3258c51733c1f09889b85ad356d0dd";
hash = "sha256-cYwen/8F0tK+g5rSuffDjNCOIIPbgzjDSaNyjtNW9ts=";
saneCommit = "cdea9097fd6afb43751e42f1cd1b50e2bffb4d58";
hash = "sha256-33LoktURM81bLsfY3v+SHL30Qju9GyOMCXVbsGrgOjU=";
})
(fetchpatch' {
# harec: unstable-2023-02-18 -> unstable-2023-04-25
saneCommit = "5595e88de982474ba6cc9c4d7f4a7a246edb4980";
hash = "sha256-kKhygKpf3QqQR0kSxutKwZXbNcsSTp/z165h88J8/+g=";
})
# for raspberry pi: allow building u-boot for rpi 4{,00}

26
overlays/all.nix Normal file
View File

@ -0,0 +1,26 @@
# this overlay exists specifically to control the order in which other overlays are applied.
# for example, `pkgs` *must* be added before `cross`, as the latter applies overrides
# to the packages defined in the former.
final: prev:
let
pins = import ./pins.nix;
pkgs = import ./pkgs.nix;
disable-flakey-tests = import ./disable-flakey-tests.nix;
optimizations = import ./optimizations.nix;
cross = import ./cross.nix;
isCross = prev.stdenv.hostPlatform != prev.stdenv.buildPlatform;
ifCross = overlay: if isCross then overlay else (_: _: {});
renderOverlays = overlays: builtins.foldl'
(acc: thisOverlay: acc // (thisOverlay final acc))
prev
overlays;
in
renderOverlays [
pins
pkgs
disable-flakey-tests
(ifCross optimizations)
(ifCross cross)
]

1148
overlays/cross.nix Normal file

File diff suppressed because it is too large Load Diff