Skip to content

Commit

Permalink
sd-image: Fix cross compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvishJerricco authored and dezgeg committed Aug 21, 2018
1 parent 47d2f92 commit f0957b9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions nixos/modules/installer/cd-dvd/sd-image.nix
Expand Up @@ -12,13 +12,12 @@
with lib;

let
rootfsImage = import ../../../lib/make-ext4-fs.nix {
inherit pkgs;
rootfsImage = pkgs.callPackage ../../../lib/make-ext4-fs.nix ({
inherit (config.sdImage) storePaths;
volumeLabel = "NIXOS_SD";
} // optionalAttrs (config.sdImage.rootPartitionUUID != null) {
uuid = config.sdImage.rootPartitionUUID;
};
});
in
{
options.sdImage = {
Expand Down Expand Up @@ -94,10 +93,10 @@ in

sdImage.storePaths = [ config.system.build.toplevel ];

system.build.sdImage = pkgs.stdenv.mkDerivation {
system.build.sdImage = pkgs.callPackage ({ stdenv, dosfstools, e2fsprogs, mtools, libfaketime, utillinux }: stdenv.mkDerivation {
name = config.sdImage.imageName;

buildInputs = with pkgs; [ dosfstools e2fsprogs mtools libfaketime utillinux ];
nativeBuildInputs = [ dosfstools e2fsprogs mtools libfaketime utillinux ];

buildCommand = ''
mkdir -p $out/nix-support $out/sd-image
Expand Down Expand Up @@ -138,7 +137,7 @@ in
(cd boot; mcopy -bpsvm -i ../bootpart.img ./* ::)
dd conv=notrunc if=bootpart.img of=$img seek=$START count=$SECTORS
'';
};
}) {};

boot.postBootCommands = ''
# On the first boot do some maintenance tasks
Expand Down

0 comments on commit f0957b9

Please sign in to comment.