Change:
takes an argument that copies source paths into the resulting VM image. It seems to work fine when the sources are files or , but when copying directories, they end up nested inside the target directory named with a nix-store-like path. This is not what I expected, it is hard to use, and I do not think it is the intended behavior. these files: (and additional , see attached ). the VM image with . the VM image, e.g. with . in with credentials literal . that contains a subdirectory with a Nix-store-like path, e.g. instead of . I expected that the source would end up at the target, as happens with contents objects that are files. ! I will have a PR with a test and fix up soon. When changing the behavior of a function that is already widely used, even fixing a bug can cause problems for people. I checked, but I did not find any existing usages of with directories in . And given how broken the directory support seems, I suspect that it is not actually used in the wild, so I think it is okay to fix this behavior. Please run and paste the result.

Discussion:
- The `bind` module now allows the per-zone `allow-query` setting to be configured (previously it was hard-coded to `any`; it still defaults to `any` to retain compatibility). <ins> - `make-disk-image` handles `contents` arguments that are directories better, fixing a bug where it used to put them in a subdirectory of the intended `target`. </ins> ## Detailed migration information {#sec-release-23.05-migration} ### Pipewire configuration overrides {#sec-release-23.05-migration-pipewire}

done else mkdir -p $root/$(dirname $target) <del> if ! [ -e $root/$target ]; then rsync $rsync_flags $source $root/$target else </del> <ins> if [ -e $root/$target ]; then </ins> echo "duplicate entry $target -> $source" exit 1 <ins> elif [ -d $source ]; then # Append a slash to the end of source to get rsync to copy the # directory _to_ the target instead of _inside_ the target. # (See `man rsync`'s note on a trailing slash.) rsync $rsync_flags $source/ $root/$target else rsync $rsync_flags $source $root/$target </ins> fi fi done

ln -s ${pkgs.writeText "sshPublicKey" sshPublicKey} $out/1.0/meta-data/public-keys/0/openssh-key ''; }; <ins> indentLines = str: concatLines (map (s: "  " + s) (splitString "n" str)); </ins> in makeTest { name = "ec2-" + name; nodes = {};

"create", "-f", "qcow2", <ins> "-F", "qcow2", </ins> "-o", "backing_file=${image}", disk_image,

) machine = create_machine({"startCommand": start_command}) <del> '' + script; </del> <ins> try: '' + indentLines script + '' finally: machine.shutdown() ''; </ins> inherit meta; };

inherit pkgs config; lib = pkgs.lib; format = "qcow2"; <del> contents = [{ source = pkgs.writeText "testFile" "contents"; target = "/testFile"; user = "1234"; group = "5678"; mode = "755"; }]; </del> <ins> contents = [ { source = pkgs.writeText "testFile" "contents"; target = "/testFile"; user = "1234"; group = "5678"; mode = "755"; } { source = ./.; target = "/testDir"; } ]; </ins> }) + "/nixos.qcow2"; in makeEc2Test {

userData = null; script = '' machine.start() <ins> # Test that if contents includes a file, it is copied to the target. </ins> assert "content" in machine.succeed("cat /testFile") fileDetails = machine.succeed("ls -l /testFile") assert "1234" in fileDetails assert "5678" in fileDetails assert "rwxr-xr-x" in fileDetails <ins> # Test that if contents includes a directory, it is copied to the target. dirList = machine.succeed("ls /testDir") assert "image-contents.nix" in dirList </ins> ''; }