lol

treewide: switch builtins.fromJSON(builtins.readFile ./file.json) to lib.importJSON ./file.json #2

+26 -26
+1 -1
pkgs/applications/emulators/retroarch/cores.nix
··· 42 42 }: 43 43 44 44 let 45 - hashesFile = builtins.fromJSON (builtins.readFile ./hashes.json); 45 + hashesFile = lib.importJSON ./hashes.json; 46 46 47 47 getCoreSrc = core: 48 48 fetchFromGitHub (builtins.getAttr core hashesFile);
+2 -2
pkgs/applications/networking/browsers/librewolf/src.nix
··· 1 - { fetchurl, fetchFromGitLab }: 2 - let src = builtins.fromJSON (builtins.readFile ./src.json); 1 + { lib, fetchurl, fetchFromGitLab }: 2 + let src = lib.importJSON ./src.json; 3 3 in 4 4 { 5 5 inherit (src) packageVersion;
+2 -2
pkgs/build-support/flutter/default.nix
··· 135 135 packageOverrideRepository = (callPackage ../../development/compilers/flutter/package-overrides { }) // customPackageOverrides; 136 136 productPackages = builtins.filter (package: package.kind != "dev") 137 137 (if autoDepsList 138 - then builtins.fromJSON (builtins.readFile deps.depsListFile) 138 + then lib.importJSON deps.depsListFile 139 139 else 140 140 if depsListFile == null 141 141 then [ ] 142 - else builtins.fromJSON (builtins.readFile depsListFile)); 142 + else lib.importJSON depsListFile); 143 143 in 144 144 builtins.foldl' 145 145 (prev: package:
+1 -1
pkgs/data/misc/hackage/default.nix
··· 2 2 # and callHackage 3 3 { lib, fetchurl }: 4 4 let 5 - pin = builtins.fromJSON (builtins.readFile ./pin.json); 5 + pin = lib.importJSON ./pin.json; 6 6 in 7 7 fetchurl { 8 8 inherit (pin) url sha256;
+1 -1
pkgs/development/libraries/ndi/default.nix
··· 1 1 { lib, stdenv, requireFile, avahi, obs-studio-plugins }: 2 2 3 3 let 4 - versionJSON = builtins.fromJSON (builtins.readFile ./version.json); 4 + versionJSON = lib.importJSON ./version.json; 5 5 in 6 6 stdenv.mkDerivation rec { 7 7 pname = "ndi";
+1 -1
pkgs/development/tools/build-managers/scala-cli/default.nix
··· 12 12 13 13 let 14 14 pname = "scala-cli"; 15 - sources = builtins.fromJSON (builtins.readFile ./sources.json); 15 + sources = lib.importJSON ./sources.json; 16 16 inherit (sources) version assets; 17 17 18 18 platforms = builtins.attrNames assets;
+1 -1
pkgs/development/tools/mongosh/default.nix
··· 6 6 }: 7 7 8 8 let 9 - source = builtins.fromJSON (builtins.readFile ./source.json); 9 + source = lib.importJSON ./source.json; 10 10 in 11 11 buildNpmPackage { 12 12 pname = "mongosh";
+1 -1
pkgs/development/tools/poetry2nix/poetry2nix/default.nix
··· 17 17 toPluginAble = (import ./plugins.nix { inherit pkgs lib; }).toPluginAble; 18 18 19 19 # List of known build systems that are passed through from nixpkgs unmodified 20 - knownBuildSystems = builtins.fromJSON (builtins.readFile ./known-build-systems.json); 20 + knownBuildSystems = lib.importJSON ./known-build-systems.json; 21 21 nixpkgsBuildSystems = lib.subtractLists [ "poetry" "poetry-core" ] knownBuildSystems; 22 22 23 23 mkInputAttrs =
+1 -1
pkgs/development/tools/swiftpm2nix/support.nix
··· 19 19 # Make packaging helpers from swiftpm2nix generated output. 20 20 helpers = generated: let 21 21 inherit (import generated) workspaceStateFile hashes; 22 - workspaceState = builtins.fromJSON (builtins.readFile workspaceStateFile); 22 + workspaceState = lib.importJSON workspaceStateFile; 23 23 pinFile = mkPinFile workspaceState; 24 24 in rec { 25 25
+1 -1
pkgs/development/tools/tabnine/default.nix
··· 1 1 { stdenv, lib, fetchurl, unzip }: 2 2 let 3 - sources = builtins.fromJSON (builtins.readFile ./sources.json); 3 + sources = lib.importJSON ./sources.json; 4 4 platform = 5 5 if (builtins.hasAttr stdenv.hostPlatform.system sources.platforms) then 6 6 builtins.getAttr (stdenv.hostPlatform.system) sources.platforms
+1 -1
pkgs/servers/invidious/default.nix
··· 12 12 # * update lsquic and boringssl if necessarry, lsquic.cr depends on 13 13 # the same version of lsquic and lsquic requires the boringssl 14 14 # commit mentioned in its README 15 - versions = builtins.fromJSON (builtins.readFile ./versions.json); 15 + versions = lib.importJSON ./versions.json; 16 16 in 17 17 crystal.buildCrystalPackage rec { 18 18 pname = "invidious";
+1 -1
pkgs/servers/invidious/lsquic.nix
··· 1 1 { lib, boringssl, stdenv, fetchgit, fetchFromGitHub, fetchurl, cmake, zlib, perl, libevent }: 2 2 let 3 - versions = builtins.fromJSON (builtins.readFile ./versions.json); 3 + versions = lib.importJSON ./versions.json; 4 4 5 5 fetchGitilesPatch = { name, url, sha256 }: 6 6 fetchurl {
+2 -2
pkgs/servers/invidious/videojs.nix
··· 1 - { stdenvNoCC, cacert, crystal, openssl, pkg-config, invidious }: 1 + { lib, stdenvNoCC, cacert, crystal, openssl, pkg-config, invidious }: 2 2 3 3 let 4 - versions = builtins.fromJSON (builtins.readFile ./versions.json); 4 + versions = lib.importJSON ./versions.json; 5 5 in 6 6 stdenvNoCC.mkDerivation { 7 7 name = "videojs";
+2 -2
pkgs/servers/nosql/cassandra/3.0.nix
··· 1 - { callPackage, ... } @ args: 1 + { callPackage, lib, ... } @ args: 2 2 callPackage ./generic.nix ( 3 3 args 4 - // builtins.fromJSON (builtins.readFile ./3.0.json) 4 + // lib.importJSON ./3.0.json 5 5 // { 6 6 generation = "3_0"; 7 7 })
+2 -2
pkgs/servers/nosql/cassandra/3.11.nix
··· 1 - { callPackage, ... } @ args: 1 + { callPackage, lib, ... } @ args: 2 2 callPackage ./generic.nix ( 3 3 args 4 - // builtins.fromJSON (builtins.readFile ./3.11.json) 4 + // lib.importJSON ./3.11.json 5 5 // { 6 6 generation = "3_11"; 7 7 })
+2 -2
pkgs/servers/nosql/cassandra/4.nix
··· 1 1 # GENERATED BY update.sh 2 - { callPackage, ... } @ args: 2 + { callPackage, lib, ... } @ args: 3 3 callPackage ./generic.nix ( 4 4 args 5 - // builtins.fromJSON (builtins.readFile ./4.json) 5 + // lib.importJSON ./4.json 6 6 // { 7 7 generation = "4"; 8 8 })
+1 -1
pkgs/tools/admin/google-cloud-sdk/components.nix
··· 38 38 39 39 # A description of all available google-cloud-sdk components. 40 40 # It's a JSON file with a list of components, along with some metadata 41 - snapshot = builtins.fromJSON (builtins.readFile snapshotPath); 41 + snapshot = lib.importJSON snapshotPath; 42 42 43 43 # Generate a snapshot file for a single component. It has the same format as 44 44 # `snapshot`, but only contains a single component. These files are
+1 -1
pkgs/tools/nix/npins/default.nix
··· 15 15 16 16 let 17 17 runtimePath = lib.makeBinPath [ nix nix-prefetch-git git ]; 18 - sources = (builtins.fromJSON (builtins.readFile ./sources.json)).pins; 18 + sources = (lib.importJSON ./sources.json).pins; 19 19 in rustPlatform.buildRustPackage rec { 20 20 pname = "npins"; 21 21 version = src.version;
+1 -1
pkgs/tools/nix/npins/source.nix
··· 3 3 # Usage: 4 4 # ```nix 5 5 # let 6 - # sources = builtins.fromJSON (builtins.readFile ./sources.json); 6 + # sources = lib.importJSON ./sources.json; 7 7 # in mkMyDerivation rec { 8 8 # version = src.version; # This obviously only works for releases 9 9 # src = pkgs.npins.mkSource sources.mySource;