Skip to content

Commit

Permalink
make-disk-image: replace nixos-install by nix-env calls
Browse files Browse the repository at this point in the history
nixos-install can only be called from a machine
  • Loading branch information
ckesg committed Sep 29, 2019
1 parent 66967ec commit e9bf955
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nixos/lib/make-disk-image.nix
Expand Up @@ -180,9 +180,17 @@ let format' = format; in let
export NIX_STATE_DIR=$TMPDIR/state
nix-store --load-db < ${closureInfo}/registration
echo "running nixos-install..."
nixos-install --root $root --no-bootloader --no-root-passwd \
--system ${config.system.build.toplevel} --channel ${channelSources} --substituters ""
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 "copying staging root to image..."
cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* /
Expand Down

0 comments on commit e9bf955

Please sign in to comment.