mirror of
https://github.com/nix-community/disko.git
synced 2026-12-02 05:53:28 +01:00
make-disk-image: format natively
This commit is contained in:
1 parent
6438340415
commit
e51159153b
1 file changed
+15
-2
+15
-2
@@ -51,6 +51,18 @@ let
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
systemToInstallNative = if binfmt.systemsAreDifferent then extendModules {
|
||||||
|
modules = [
|
||||||
|
cfg.extraConfig
|
||||||
|
{
|
||||||
|
disko.testMode = true;
|
||||||
|
disko.devices = lib.mkForce cleanedConfig.disko.devices;
|
||||||
|
boot.loader.grub.devices = lib.mkForce cleanedConfig.boot.loader.grub.devices;
|
||||||
|
nixpkgs.hostPlatform = lib.mkForce pkgs.stdenv.hostPlatform;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
else systemToInstall;
|
||||||
dependencies = with pkgs; [
|
dependencies = with pkgs; [
|
||||||
bash
|
bash
|
||||||
coreutils
|
coreutils
|
||||||
@@ -88,7 +100,7 @@ let
|
|||||||
ln -sfn /proc/self/fd/2 /dev/stderr
|
ln -sfn /proc/self/fd/2 /dev/stderr
|
||||||
mkdir -p /etc/udev
|
mkdir -p /etc/udev
|
||||||
mount -t efivarfs none /sys/firmware/efi/efivars
|
mount -t efivarfs none /sys/firmware/efi/efivars
|
||||||
ln -sfn ${systemToInstall.config.system.build.etc}/etc/udev/rules.d /etc/udev/rules.d
|
ln -sfn ${systemToInstallNative.config.system.build.etc}/etc/udev/rules.d /etc/udev/rules.d
|
||||||
mkdir -p /dev/.mdadm
|
mkdir -p /dev/.mdadm
|
||||||
${pkgs.systemdMinimal}/lib/systemd/systemd-udevd --daemon
|
${pkgs.systemdMinimal}/lib/systemd/systemd-udevd --daemon
|
||||||
partprobe
|
partprobe
|
||||||
@@ -98,10 +110,11 @@ let
|
|||||||
${lib.optionalString diskoCfg.testMode ''
|
${lib.optionalString diskoCfg.testMode ''
|
||||||
export IN_DISKO_TEST=1
|
export IN_DISKO_TEST=1
|
||||||
''}
|
''}
|
||||||
${lib.getExe systemToInstall.config.system.build.destroyFormatMount} --yes-wipe-all-disks
|
${lib.getExe systemToInstallNative.config.system.build.destroyFormatMount} --yes-wipe-all-disks
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installer = lib.optionalString cfg.copyNixStore ''
|
installer = lib.optionalString cfg.copyNixStore ''
|
||||||
|
${binfmtSetup}
|
||||||
# populate nix db, so nixos-install doesn't complain
|
# populate nix db, so nixos-install doesn't complain
|
||||||
export NIX_STATE_DIR=${systemToInstall.config.disko.rootMountPoint}/nix/var/nix
|
export NIX_STATE_DIR=${systemToInstall.config.disko.rootMountPoint}/nix/var/nix
|
||||||
nix-store --load-db < "${closureInfo}/registration"
|
nix-store --load-db < "${closureInfo}/registration"
|
||||||
|
|||||||
Reference in new issue
Block a user