Revert "make-disk-image: replace nixos-install by nix-env calls"

This reverts commit e9bf955fd6. We use
nixos-install to ensure that make-disk-image produces the same result
as a regular installation (9802da517f)
and to reduce code duplication. If there is something broken in
nixos-install, it should be fixed there.
wip/yesman
Eelco Dolstra 5 years ago
parent 8044cf3668
commit 39c0e489d3
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE
  1. 14
      nixos/lib/make-disk-image.nix

@ -180,17 +180,9 @@ let format' = format; in let
export NIX_STATE_DIR=$TMPDIR/state
nix-store --load-db < ${closureInfo}/registration
mkdir -m 0755 -p "$root/etc"
touch "$root/etc/NIXOS"
echo "copying system..."
nix-env --store "$root" --substituters "auto?trusted=1" \
-p "$root/nix/var/nix/profiles/system" --set "${config.system.build.toplevel}" --quiet
echo "copying channel..."
mkdir -p "$root/nix/var/nix/profiles/per-user/root"
nix-env --store "$root" --substituters "auto?trusted=1" \
-p "$root/nix/var/nix/profiles/per-user/root/channels" --set "${channelSources}" --quiet
echo "running nixos-install..."
nixos-install --root $root --no-bootloader --no-root-passwd \
--system ${config.system.build.toplevel} --channel ${channelSources} --substituters ""
echo "copying staging root to image..."
cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* /

Loading…
Cancel
Save