Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

make-iso9660-image: use `__structuredAttrs`

Makes it easier to enable discarding of references, a feature of Nix
2.14 which requires structured attrs.

+11 -20
+3 -3
nixos/lib/make-iso9660-image.nix
··· 47 47 48 48 stdenv.mkDerivation { 49 49 name = isoName; 50 - builder = ./make-iso9660-image.sh; 50 + __structuredAttrs = true; 51 + 52 + buildCommandPath = ./make-iso9660-image.sh; 51 53 nativeBuildInputs = [ xorriso syslinux zstd libossp_uuid ]; 52 54 53 55 inherit isoName bootable bootImage compressImage volumeID efiBootImage efiBootable isohybridMbrImage usbBootable; 54 56 55 - # !!! should use XML. 56 57 sources = map (x: x.source) contents; 57 58 targets = map (x: x.target) contents; 58 59 59 - # !!! should use XML. 60 60 objects = map (x: x.object) storeContents; 61 61 symlinks = map (x: x.symlink) storeContents; 62 62
+8 -17
nixos/lib/make-iso9660-image.sh
··· 1 - source $stdenv/setup 2 - 3 - sources_=($sources) 4 - targets_=($targets) 5 - 6 - objects=($objects) 7 - symlinks=($symlinks) 8 - 9 - 10 1 # Remove the initial slash from a path, since genisofs likes it that way. 11 2 stripSlash() { 12 3 res="$1" ··· 35 26 # The -boot-info-table option modifies the $bootImage file, so 36 27 # find it in `contents' and make a copy of it (since the original 37 28 # is read-only in the Nix store...). 38 - for ((i = 0; i < ${#targets_[@]}; i++)); do 39 - stripSlash "${targets_[$i]}" 29 + for ((i = 0; i < ${#targets[@]}; i++)); do 30 + stripSlash "${targets[$i]}" 40 31 if test "$res" = "$bootImage"; then 41 - echo "copying the boot image ${sources_[$i]}" 42 - cp "${sources_[$i]}" boot.img 32 + echo "copying the boot image ${sources[$i]}" 33 + cp "${sources[$i]}" boot.img 43 34 chmod u+w boot.img 44 - sources_[$i]=boot.img 35 + sources[$i]=boot.img 45 36 fi 46 37 done 47 38 ··· 66 57 67 58 68 59 # Add the individual files. 69 - for ((i = 0; i < ${#targets_[@]}; i++)); do 70 - stripSlash "${targets_[$i]}" 71 - addPath "$res" "${sources_[$i]}" 60 + for ((i = 0; i < ${#targets[@]}; i++)); do 61 + stripSlash "${targets[$i]}" 62 + addPath "$res" "${sources[$i]}" 72 63 done 73 64 74 65