Skip to content

Commit 9a7ab51

Browse files
committed
Set buildPlatform in make-disk-image
Currently if building an image using cross compilation: nixpkgs = { config.allowUnsupportedSystem = true; hostPlatform = "armv7l-linux"; buildPlatform = "x86_64-linux"; }; And resetting the Disko packages for binFmt use: disko.imageBuilder = let diskoPkgs = nixpkgs.legacyPackages."x86_64-linux"; in { enableBinfmt = true; pkgs = diskoPkgs; kernelPackages = diskoPkgs.linuxPackages_latest; }; Something will differ between host/build Platform in diskoPkgs (Not sure what, they look the same when tracing but there is functions that maybe differ) causing it to miss the nixpkgs cache and rebuilding for x86_64-linux. Also resettings buildPlatform fixes this.
1 parent 19c1140 commit 9a7ab51

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/make-disk-image.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ let
7474
disko.devices = lib.mkForce cleanedConfig.disko.devices;
7575
boot.loader.grub.devices = lib.mkForce cleanedConfig.boot.loader.grub.devices;
7676
nixpkgs.hostPlatform = lib.mkForce pkgs.stdenv.hostPlatform;
77+
nixpkgs.buildPlatform = lib.mkForce pkgs.stdenv.hostPlatform;
7778
}
7879
];
7980
}

0 commit comments

Comments
 (0)