flake: apply nixpatches/list.nix using the build patcher, not the emulated host patcher
This commit is contained in:
parent
2685c91dd9
commit
3b5ff938ce
18
flake.nix
18
flake.nix
|
@ -94,7 +94,17 @@
|
||||||
evalHost = { name, local, target }: nixpkgs.lib.nixosSystem {
|
evalHost = { name, local, target }: nixpkgs.lib.nixosSystem {
|
||||||
system = target;
|
system = target;
|
||||||
modules = [
|
modules = [
|
||||||
(import ./hosts/instantiate.nix { localSystem = local; hostName = name; })
|
{
|
||||||
|
nixpkgs = (if (local != null) then {
|
||||||
|
buildPlatform = local;
|
||||||
|
} else {}) // {
|
||||||
|
# TODO: does the earlier `system` arg to nixosSystem make its way here?
|
||||||
|
hostPlatform.system = target;
|
||||||
|
};
|
||||||
|
# nixpkgs.buildPlatform = local; # set by instantiate.nix instead
|
||||||
|
# nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv;
|
||||||
|
}
|
||||||
|
(import ./hosts/instantiate.nix { hostName = name; })
|
||||||
self.nixosModules.default
|
self.nixosModules.default
|
||||||
self.nixosModules.passthru
|
self.nixosModules.passthru
|
||||||
{
|
{
|
||||||
|
@ -103,12 +113,6 @@
|
||||||
self.overlays.sane-all
|
self.overlays.sane-all
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
({ lib, ... }: {
|
|
||||||
# TODO: does the earlier `system` arg to nixosSystem make its way here?
|
|
||||||
nixpkgs.hostPlatform.system = target;
|
|
||||||
# nixpkgs.buildPlatform = local; # set by instantiate.nix instead
|
|
||||||
# nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# trampoline from flake.nix into the specific host definition, while doing a tiny bit of common setup
|
# trampoline from flake.nix into the specific host definition, while doing a tiny bit of common setup
|
||||||
|
|
||||||
# args from flake-level `import`
|
# args from flake-level `import`
|
||||||
{ hostName, localSystem }:
|
{ hostName }:
|
||||||
|
|
||||||
# module args
|
# module args
|
||||||
{ lib, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
@ -14,5 +14,4 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hostName = hostName;
|
networking.hostName = hostName;
|
||||||
nixpkgs.buildPlatform = lib.mkIf (localSystem != null) localSystem;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,15 @@
|
||||||
patchedFlakeFor = system: import "${patchedPkgsFor system}/flake.nix";
|
patchedFlakeFor = system: import "${patchedPkgsFor system}/flake.nix";
|
||||||
patchedFlakeOutputsFor = system:
|
patchedFlakeOutputsFor = system:
|
||||||
(patchedFlakeFor system).outputs { inherit self; };
|
(patchedFlakeFor system).outputs { inherit self; };
|
||||||
|
|
||||||
|
extractBuildPlatform = nixosSystemArgs:
|
||||||
|
let
|
||||||
|
firstMod = builtins.head nixosSystemArgs.modules;
|
||||||
|
in
|
||||||
|
firstMod.nixpkgs.buildPlatform or nixosSystemArgs.system;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
lib.nixosSystem = args: (patchedFlakeOutputsFor args.system).lib.nixosSystem args;
|
lib.nixosSystem = args: (patchedFlakeOutputsFor (extractBuildPlatform args)).lib.nixosSystem args;
|
||||||
|
|
||||||
legacyPackages = builtins.mapAttrs
|
legacyPackages = builtins.mapAttrs
|
||||||
(system: _:
|
(system: _:
|
||||||
|
|
Loading…
Reference in New Issue