diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-10-07 17:21:28 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-10-07 17:21:28 +0200 |
commit | 39c0e489d3e3e56ae848075bb6b2257176d48d32 (patch) | |
tree | e47611517c3c58960ea82bc9302d8707834703c0 /nixos/lib | |
parent | 8044cf3668886a650ac2af1fd644dbe8f7f62436 (diff) | |
download | nixlib-39c0e489d3e3e56ae848075bb6b2257176d48d32.tar nixlib-39c0e489d3e3e56ae848075bb6b2257176d48d32.tar.gz nixlib-39c0e489d3e3e56ae848075bb6b2257176d48d32.tar.bz2 nixlib-39c0e489d3e3e56ae848075bb6b2257176d48d32.tar.lz nixlib-39c0e489d3e3e56ae848075bb6b2257176d48d32.tar.xz nixlib-39c0e489d3e3e56ae848075bb6b2257176d48d32.tar.zst nixlib-39c0e489d3e3e56ae848075bb6b2257176d48d32.zip |
Revert "make-disk-image: replace nixos-install by nix-env calls"
This reverts commit e9bf955fd6d5ffda218878ba561c93c6a28dfe8e. We use nixos-install to ensure that make-disk-image produces the same result as a regular installation (9802da517fe4da41d68516029b01c5c1f175b3e4) and to reduce code duplication. If there is something broken in nixos-install, it should be fixed there.
Diffstat (limited to 'nixos/lib')
-rw-r--r-- | nixos/lib/make-disk-image.nix | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index de4aacf2319b..5e86ea479d51 100644 --- a/nixos/lib/make-disk-image.nix +++ b/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/* / |