diff --git a/docs/disko-images.md b/docs/disko-images.md index 7d1bd5b7..3a949a48 100644 --- a/docs/disko-images.md +++ b/docs/disko-images.md @@ -71,15 +71,15 @@ In the this example we create a flake containing a nixos configuration for Options: * --pre-format-files - copies the src to the dst on the VM, before disko is run + copies the content of path to path on the VM, before disko is run This is useful to provide secrets like LUKS keys, or other files you need for formatting * --post-format-files - copies the src to the dst on the finished image + copies the content of path to path on the finished image These end up in the images later and is useful if you want to add some extra stateful files They will have the same permissions but will be owned by root:root * --build-memory specify the amount of memory in MiB that gets allocated to the build VM - This can be useful if you want to build images with a more involed NixOS config + This can be useful if you want to build images with a more involved NixOS config The default is 1024 MiB ``` diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix index ef527457..44ae70ec 100644 --- a/lib/make-disk-image.nix +++ b/lib/make-disk-image.nix @@ -179,15 +179,15 @@ in Options: * --pre-format-files - copies the src to the dst on the VM, before disko is run + copies the content of path to path on the VM, before disko is run This is useful to provide secrets like LUKS keys, or other files you need for formatting * --post-format-files - copies the src to the dst on the finished image + copies the content of path to path on the finished image These end up in the images later and is useful if you want to add some extra stateful files They will have the same permissions but will be owned by root:root * --build-memory specify the amount of memory in MiB that gets allocated to the build VM - This can be useful if you want to build images with a more involed NixOS config + This can be useful if you want to build images with a more involved NixOS config The default is disko.memSize which defaults to ${builtins.toString options.disko.memSize.default} MiB USAGE } @@ -207,13 +207,13 @@ in --pre-format-files) src=$2 dst=$3 - cp --reflink=auto -r "$src" copy_before_disko/"$(echo "$dst" | base64)" + cp --reflink=auto -rv "$src" copy_before_disko/"$(echo "$dst" | base64)" shift 2 ;; --post-format-files) src=$2 dst=$3 - cp --reflink=auto -r "$src" copy_after_disko/"$(echo "$dst" | base64)" + cp --reflink=auto -rv "$src" copy_after_disko/"$(echo "$dst" | base64)" shift 2 ;; --build-memory) @@ -243,8 +243,8 @@ in for src in /tmp/xchg/copy_before_disko/*; do [ -e "$src" ] || continue dst=$(basename "$src" | base64 -d) - mkdir -p "$(dirname "$dst")" - cp -r "$src" "$dst" + mkdir -p "$dst" + cp -rv "$src"/. "$dst" done set -f ${partitioner} @@ -252,8 +252,8 @@ in for src in /tmp/xchg/copy_after_disko/*; do [ -e "$src" ] || continue dst=/mnt/$(basename "$src" | base64 -d) - mkdir -p "$(dirname "$dst")" - cp -r "$src" "$dst" + mkdir -p "$dst" + cp -rv "$src"/. "$dst" done ${installer} ''}