make-system-tarball: use `__structuredAttrs`

Based on https://github.com/NixOS/nixpkgs/commit/ea81a2465eeef6d470786a4e8a8c5d8e9b5db9f3

+3 -3
nixos/lib/make-system-tarball.nix
···
stdenv.mkDerivation {
name = "tarball";
-
builder = ./make-system-tarball.sh;
+
__structuredAttrs = true;
+
+
buildCommandPath = ./make-system-tarball.sh;
nativeBuildInputs = extraInputs;
inherit
···
compressCommand
;
-
# !!! should use XML.
sources = map (x: x.source) contents;
targets = map (x: x.target) contents;
-
# !!! should use XML.
inherit symlinks objects;
closureInfo = closureInfo {
+3 -10
nixos/lib/make-system-tarball.sh
···
-
sources_=($sources)
-
targets_=($targets)
-
-
objects=($objects)
-
symlinks=($symlinks)
-
-
# Remove the initial slash from a path, since genisofs likes it that way.
stripSlash() {
res="$1"
···
}
# Add the individual files.
-
for ((i = 0; i < ${#targets_[@]}; i++)); do
-
stripSlash "${targets_[$i]}"
+
for ((i = 0; i < ${#targets[@]}; i++)); do
+
stripSlash "${targets[$i]}"
mkdir -p "$(dirname "$res")"
-
cp -a "${sources_[$i]}" "$res"
+
cp -a "${sources[$i]}" "$res"
done