diff --git a/pkgs/by-name/gr/grub2/package.nix b/pkgs/by-name/gr/grub2/package.nix index 35acf233f794..0fba3264c7c8 100644 --- a/pkgs/by-name/gr/grub2/package.nix +++ b/pkgs/by-name/gr/grub2/package.nix @@ -22,7 +22,7 @@ fetchpatch, buildPackages, nixosTests, - fuse, # only needed for grub-mount + fuse3, # only needed for grub-mount runtimeShell, zfs ? null, efiSupport ? false, @@ -616,7 +616,7 @@ stdenv.mkDerivation rec { libusb-compat-0_1 freetype lvm2 - fuse + fuse3 libtool bash ] diff --git a/pkgs/by-name/ty/ty/package.nix b/pkgs/by-name/ty/ty/package.nix index fad959f944ae..c1a1f061bebe 100644 --- a/pkgs/by-name/ty/ty/package.nix +++ b/pkgs/by-name/ty/ty/package.nix @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "ty"; - version = "0.0.44"; + version = "0.0.46"; __structuredAttrs = true; src = fetchFromGitHub { @@ -25,7 +25,7 @@ rustPlatform.buildRustPackage (finalAttrs: { repo = "ty"; tag = finalAttrs.version; fetchSubmodules = true; - hash = "sha256-P19+C6u0mkIrR0H8M/l7Wn3r8JSY4Ul9p64oXaLdWCQ="; + hash = "sha256-IZgQduqsQU8wMu0yW3SYypEzAJ0gmDObTJ75xG88xbA="; }; # For Darwin platforms, remove the integration test for file notifications, @@ -39,7 +39,7 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoBuildFlags = [ "--package=ty" ]; - cargoHash = "sha256-d2iV7iWf7lVhj1Bbaxxk5Zao4KK3oC7whppRvk0erzA="; + cargoHash = "sha256-rSvaYddm5n1qtPRHfY6du0aA1t2TsIqzTPnHQ9NHMP8="; nativeBuildInputs = [ installShellFiles ]; buildInputs = [ rust-jemalloc-sys ]; diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix index 57517472e08f..2f3e5ad9d191 100644 --- a/pkgs/pkgs-lib/formats.nix +++ b/pkgs/pkgs-lib/formats.nix @@ -142,12 +142,14 @@ optionalAttrs allowAliases aliases runCommand name { nativeBuildInputs = [ jq ]; - inherit value; + value = builtins.toJSON value; preferLocalBuild = true; __structuredAttrs = true; } '' - jq .value "$NIX_ATTRS_JSON_FILE" > $out + valuePath="$TMPDIR/value" + printf "%s" "$value" > "$valuePath" + jq . "$valuePath" > $out '' ) { }; @@ -165,12 +167,14 @@ optionalAttrs allowAliases aliases runCommand name { nativeBuildInputs = [ remarshal_0_17 ]; - inherit value; + value = builtins.toJSON value; preferLocalBuild = true; __structuredAttrs = true; } '' - json2yaml --unwrap value "$NIX_ATTRS_JSON_FILE" "$out" + valuePath="$TMPDIR/value" + printf "%s" "$value" > "$valuePath" + json2yaml "$valuePath" "$out" '' ) { }; @@ -188,12 +192,14 @@ optionalAttrs allowAliases aliases runCommand name { nativeBuildInputs = [ remarshal ]; - inherit value; + value = builtins.toJSON value; preferLocalBuild = true; __structuredAttrs = true; } '' - json2yaml --unwrap value "$NIX_ATTRS_JSON_FILE" "$out" + valuePath="$TMPDIR/value" + printf "%s" "$value" > "$valuePath" + json2yaml "$valuePath" "$out" '' ) { }; @@ -932,8 +938,8 @@ optionalAttrs allowAliases aliases python3 black ]; - imports = value._imports or [ ]; - value = removeAttrs value [ "_imports" ]; + imports = builtins.toJSON (value._imports or [ ]); + value = builtins.toJSON (removeAttrs value [ "_imports" ]); pythonGen = pkgs.writeText "pythonGen" '' import json import os @@ -956,20 +962,26 @@ optionalAttrs allowAliases aliases else: return repr(value) - with open(os.environ["NIX_ATTRS_JSON_FILE"], "r") as f: - attrs = json.load(f) - if attrs["imports"] is not None: - for i in attrs["imports"]: + with open(os.environ["importsPath"], "r") as f: + imports = json.load(f) + if imports is not None: + for i in imports: print(f"import {i}") print() - for key, value in attrs["value"].items(): + with open(os.environ["valuePath"], "r") as f: + for key, value in json.load(f).items(): print(f"{key} = {recursive_repr(value)}") ''; preferLocalBuild = true; __structuredAttrs = true; } '' + export importsPath="$TMPDIR/imports" + printf "%s" "$imports" > "$importsPath" + export valuePath="$TMPDIR/value" + printf "%s" "$value" > "$valuePath" + cat "$valuePath" python3 "$pythonGen" > $out black $out '' @@ -999,14 +1011,14 @@ optionalAttrs allowAliases aliases python3Packages.xmltodict libxml2Python ]; - inherit value; + value = builtins.toJSON value; pythonGen = pkgs.writeText "pythonGen" '' import json import os import xmltodict - with open(os.environ["NIX_ATTRS_JSON_FILE"], "r") as f: - print(xmltodict.unparse(json.load(f)["value"], full_document=${ + with open(os.environ["valuePath"], "r") as f: + print(xmltodict.unparse(json.load(f), full_document=${ if withHeader then "True" else "False" }, pretty=True, indent=" " * 2)) ''; @@ -1014,6 +1026,8 @@ optionalAttrs allowAliases aliases __structuredAttrs = true; } '' + export valuePath="$TMPDIR/value" + printf "%s" "$value" > "$valuePath" python3 "$pythonGen" > $out xmllint $out > /dev/null ''