summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorWill Fancher <elvishjerricco@gmail.com>2018-06-05 03:19:08 -0400
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2018-08-21 14:05:23 +0300
commitf0957b9477822fde2403324ffb4b4780d7b353ae (patch)
treea9fe15490efcc6101ca3dd4a85239b7affb23891 /nixos/modules/installer
parent47d2f92a054b340dfc39d1a4fb30e26ffd023a2e (diff)
downloadnixlib-f0957b9477822fde2403324ffb4b4780d7b353ae.tar
nixlib-f0957b9477822fde2403324ffb4b4780d7b353ae.tar.gz
nixlib-f0957b9477822fde2403324ffb4b4780d7b353ae.tar.bz2
nixlib-f0957b9477822fde2403324ffb4b4780d7b353ae.tar.lz
nixlib-f0957b9477822fde2403324ffb4b4780d7b353ae.tar.xz
nixlib-f0957b9477822fde2403324ffb4b4780d7b353ae.tar.zst
nixlib-f0957b9477822fde2403324ffb4b4780d7b353ae.zip
sd-image: Fix cross compiling
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/cd-dvd/sd-image.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/installer/cd-dvd/sd-image.nix b/nixos/modules/installer/cd-dvd/sd-image.nix
index 311a5ff69670..2371be9d89a1 100644
--- a/nixos/modules/installer/cd-dvd/sd-image.nix
+++ b/nixos/modules/installer/cd-dvd/sd-image.nix
@@ -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 = {
@@ -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
@@ -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