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

Changed files
+150 -124
nixos
modules
services
desktops
video
epgstation
web-servers
trafficserver
tests
pkgs
applications
editors
cudatext
kakoune
plugins
networking
instant-messengers
version-management
gitlab
gitlab-workhorse
development
games
dwarf-fortress
misc
vim-plugins
vscode-extensions
ms-dotnettools-csharp
os-specific
linux
kernel
servers
asterisk
web-apps
hedgedoc
tools
networking
ngrok-2
security
enpass
onlykey
text
chroma
top-level
+4 -4
nixos/modules/services/desktops/pipewire/pipewire-media-session.nix
···
# Use upstream config files passed through spa-json-dump as the base
# Patched here as necessary for them to work with this module
defaults = {
-
alsa-monitor = (builtins.fromJSON (builtins.readFile ./media-session/alsa-monitor.conf.json));
-
bluez-monitor = (builtins.fromJSON (builtins.readFile ./media-session/bluez-monitor.conf.json));
-
media-session = (builtins.fromJSON (builtins.readFile ./media-session/media-session.conf.json));
-
v4l2-monitor = (builtins.fromJSON (builtins.readFile ./media-session/v4l2-monitor.conf.json));
+
alsa-monitor = lib.importJSON ./media-session/alsa-monitor.conf.json;
+
bluez-monitor = lib.importJSON ./media-session/bluez-monitor.conf.json;
+
media-session = lib.importJSON ./media-session/media-session.conf.json;
+
v4l2-monitor = lib.importJSON ./media-session/v4l2-monitor.conf.json;
};
configs = {
+5 -5
nixos/modules/services/desktops/pipewire/pipewire.nix
···
# Use upstream config files passed through spa-json-dump as the base
# Patched here as necessary for them to work with this module
defaults = {
-
client = builtins.fromJSON (builtins.readFile ./daemon/client.conf.json);
-
client-rt = builtins.fromJSON (builtins.readFile ./daemon/client-rt.conf.json);
-
jack = builtins.fromJSON (builtins.readFile ./daemon/jack.conf.json);
-
pipewire = builtins.fromJSON (builtins.readFile ./daemon/pipewire.conf.json);
-
pipewire-pulse = builtins.fromJSON (builtins.readFile ./daemon/pipewire-pulse.conf.json);
+
client = lib.importJSON ./daemon/client.conf.json;
+
client-rt = lib.importJSON ./daemon/client-rt.conf.json;
+
jack = lib.importJSON ./daemon/jack.conf.json;
+
pipewire = lib.importJSON ./daemon/pipewire.conf.json;
+
pipewire-pulse = lib.importJSON ./daemon/pipewire-pulse.conf.json;
};
configs = {
+1 -1
nixos/modules/services/video/epgstation/default.nix
···
fi
'';
-
streamingConfig = builtins.fromJSON (builtins.readFile ./streaming.json);
+
streamingConfig = lib.importJSON ./streaming.json;
logConfig = {
appenders.stdout.type = "stdout";
categories = {
+2 -2
nixos/modules/services/web-servers/trafficserver/default.nix
···
ipAllow = mkOption {
type = types.nullOr yaml.type;
-
default = builtins.fromJSON (builtins.readFile ./ip_allow.json);
+
default = lib.importJSON ./ip_allow.json;
defaultText = literalDocBook "upstream defaults";
example = literalExpression ''
{
···
logging = mkOption {
type = types.nullOr yaml.type;
-
default = builtins.fromJSON (builtins.readFile ./logging.json);
+
default = lib.importJSON ./logging.json;
defaultText = literalDocBook "upstream defaults";
example = { };
description = ''
+2 -2
nixos/tests/os-prober.nix
···
[ ./hardware-configuration.nix
<nixpkgs/nixos/modules/testing/test-instrumentation.nix>
];
-
} // (builtins.fromJSON (builtins.readFile ${
+
} // pkgs.lib.importJSON ${
pkgs.writeText "simpleConfig.json" (builtins.toJSON simpleConfig)
-
})))
+
})
'';
in {
name = "os-prober";
+1 -1
pkgs/applications/editors/cudatext/default.nix
···
inherit (spec) owner rev sha256;
}
)
-
(builtins.fromJSON (builtins.readFile ./deps.json));
+
(lib.importJSON ./deps.json);
in
stdenv.mkDerivation rec {
pname = "cudatext";
+1 -1
pkgs/applications/editors/kakoune/plugins/aliases.nix
···
deprecations = lib.mapAttrs (old: info:
throw "${old} was renamed to ${info.new} on ${info.date}. Please update to ${info.new}."
-
) (builtins.fromJSON (builtins.readFile ./deprecated.json));
+
) (lib.importJSON ./deprecated.json);
in
mapAliases ({
+1 -1
pkgs/applications/networking/instant-messengers/element/element-desktop.nix
···
}:
let
-
pinData = (builtins.fromJSON (builtins.readFile ./pin.json));
+
pinData = lib.importJSON ./pin.json;
executableName = "element-desktop";
electron_exec = if stdenv.isDarwin then "${electron}/Applications/Electron.app/Contents/MacOS/Electron" else "${electron}/bin/electron";
in
+1 -1
pkgs/applications/networking/instant-messengers/element/element-web.nix
···
{ lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
let
-
pinData = (builtins.fromJSON (builtins.readFile ./pin.json));
+
pinData = lib.importJSON ./pin.json;
noPhoningHome = {
disable_guests = true; # disable automatic guest account registration at matrix.org
piwik = false; # disable analytics
+1 -1
pkgs/applications/networking/instant-messengers/element/keytar/default.nix
···
, fixup_yarn_lock, yarn, pkg-config, libsecret, xcbuild, Security, AppKit, fetchYarnDeps }:
let
-
pinData = (builtins.fromJSON (builtins.readFile ./pin.json));
+
pinData = lib.importJSON ./pin.json;
in stdenv.mkDerivation rec {
pname = "keytar";
+1 -1
pkgs/applications/networking/instant-messengers/element/seshat/default.nix
···
{ lib, stdenv, rustPlatform, fetchFromGitHub, callPackage, sqlcipher, nodejs-14_x, python3, yarn, fixup_yarn_lock, CoreServices, fetchYarnDeps }:
let
-
pinData = (builtins.fromJSON (builtins.readFile ./pin.json));
+
pinData = lib.importJSON ./pin.json;
in rustPlatform.buildRustPackage rec {
pname = "seshat-node";
+1 -1
pkgs/applications/networking/instant-messengers/schildichat/schildichat-web.nix
···
}:
let
-
pinData = builtins.fromJSON (builtins.readFile ./pin.json);
+
pinData = lib.importJSON ./pin.json;
noPhoningHome = {
disable_guests = true; # disable automatic guest account registration at matrix.org
};
+1 -1
pkgs/applications/version-management/gitlab/default.nix
···
}:
let
-
data = (builtins.fromJSON (builtins.readFile ./data.json));
+
data = lib.importJSON ./data.json;
version = data.version;
src = fetchFromGitLab {
+1 -1
pkgs/applications/version-management/gitlab/gitlab-workhorse/default.nix
···
{ lib, fetchFromGitLab, git, buildGoModule }:
let
-
data = (builtins.fromJSON (builtins.readFile ../data.json));
+
data = lib.importJSON ../data.json;
in
buildGoModule rec {
pname = "gitlab-workhorse";
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk11-darwin.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-darwin-base.nix { sourcePerArch = sources.openjdk11.mac.jdk.hotspot; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk11-linux.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk11.linux.jdk.hotspot; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk13-darwin.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-darwin-base.nix { sourcePerArch = sources.openjdk13.mac.jdk.hotspot; knownVulnerabilities = ["Support ended"]; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk13-linux.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk13.linux.jdk.hotspot; knownVulnerabilities = ["Support ended"]; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk14-darwin.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-darwin-base.nix { sourcePerArch = sources.openjdk14.mac.jdk.hotspot; knownVulnerabilities = ["Support ended"]; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk14-linux.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk14.linux.jdk.hotspot; knownVulnerabilities = ["Support ended"]; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk15-darwin.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-darwin-base.nix { sourcePerArch = sources.openjdk15.mac.jdk.hotspot; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk15-linux.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk15.linux.jdk.hotspot; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk16-darwin.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-darwin-base.nix { sourcePerArch = sources.openjdk16.mac.jdk.hotspot; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk16-linux.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk16.linux.jdk.hotspot; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk8-darwin.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-darwin-base.nix { sourcePerArch = sources.openjdk8.mac.jdk.hotspot; };
+3 -1
pkgs/development/compilers/adoptopenjdk-bin/jdk8-linux.nix
···
+
{ lib }:
+
let
-
sources = builtins.fromJSON (builtins.readFile ./sources.json);
+
sources = lib.importJSON ./sources.json;
in
{
jdk-hotspot = import ./jdk-linux-base.nix { sourcePerArch = sources.openjdk8.linux.jdk.hotspot; };
+1 -1
pkgs/development/compilers/ghcjs/8.10/default.nix
···
, callPackage
, fetchgit
, ghcjsSrcJson ? null
-
, ghcjsSrc ? fetchgit (builtins.fromJSON (builtins.readFile ghcjsSrcJson))
+
, ghcjsSrc ? fetchgit lib.importJSON ghcjsSrcJson
, bootPkgs
, stage0
, haskellLib
+1 -1
pkgs/development/libraries/languagemachines/frog.nix
···
}:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-frog.json);
+
release = lib.importJSON ./release-info/LanguageMachines-frog.json;
in
stdenv.mkDerivation {
+1 -1
pkgs/development/libraries/languagemachines/frogdata.nix
···
}:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-frogdata.json);
+
release = lib.importJSON ./release-info/LanguageMachines-frogdata.json;
in
stdenv.mkDerivation {
+1 -1
pkgs/development/libraries/languagemachines/libfolia.nix
···
, languageMachines }:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-libfolia.json);
+
release = lib.importJSON ./release-info/LanguageMachines-libfolia.json;
in
stdenv.mkDerivation {
+1 -1
pkgs/development/libraries/languagemachines/mbt.nix
···
}:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-mbt.json);
+
release = lib.importJSON ./release-info/LanguageMachines-mbt.json;
in
stdenv.mkDerivation {
+1 -1
pkgs/development/libraries/languagemachines/ticcutils.nix
···
, libxml2, zlib, bzip2, libtar }:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-ticcutils.json);
+
release = lib.importJSON ./release-info/LanguageMachines-ticcutils.json;
in
stdenv.mkDerivation {
+1 -1
pkgs/development/libraries/languagemachines/timbl.nix
···
}:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-timbl.json);
+
release = lib.importJSON ./release-info/LanguageMachines-timbl.json;
in
stdenv.mkDerivation {
+1 -1
pkgs/development/libraries/languagemachines/timblserver.nix
···
}:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-timblserver.json);
+
release = lib.importJSON ./release-info/LanguageMachines-timblserver.json;
in
stdenv.mkDerivation {
+1 -1
pkgs/development/libraries/languagemachines/ucto.nix
···
}:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-ucto.json);
+
release = lib.importJSON ./release-info/LanguageMachines-ucto.json;
in
stdenv.mkDerivation {
+1 -1
pkgs/development/libraries/languagemachines/uctodata.nix
···
}:
let
-
release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-uctodata.json);
+
release = lib.importJSON ./release-info/LanguageMachines-uctodata.json;
in
stdenv.mkDerivation {
+2 -2
pkgs/development/mobile/androidenv/compose-android-packages.nix
···
addons = repoXmls.addons or [];
};
in
-
builtins.fromJSON (builtins.readFile "${mkRepoJson repoXmlSpec}")
+
lib.importJSON "${mkRepoJson repoXmlSpec}"
else
-
builtins.fromJSON (builtins.readFile repoJson);
+
lib.importJSON repoJson;
# Converts all 'archives' keys in a repo spec to fetchurl calls.
fetchArchives = attrSet:
+1 -1
pkgs/development/tools/build-managers/bazel/bazel_0_29/default.nix
···
srcDeps = lib.attrsets.attrValues srcDepsSet;
srcDepsSet =
let
-
srcs = (builtins.fromJSON (builtins.readFile ./src-deps.json));
+
srcs = lib.importJSON ./src-deps.json;
toFetchurl = d: lib.attrsets.nameValuePair d.name (fetchurl {
urls = d.urls;
sha256 = d.sha256;
+1 -1
pkgs/development/tools/build-managers/bazel/bazel_1/default.nix
···
srcDeps = lib.attrsets.attrValues srcDepsSet;
srcDepsSet =
let
-
srcs = (builtins.fromJSON (builtins.readFile ./src-deps.json));
+
srcs = lib.importJSON ./src-deps.json;
toFetchurl = d: lib.attrsets.nameValuePair d.name (fetchurl {
urls = d.urls;
sha256 = d.sha256;
+1 -1
pkgs/development/tools/build-managers/bazel/bazel_3/default.nix
···
srcDeps = lib.attrsets.attrValues srcDepsSet;
srcDepsSet =
let
-
srcs = (builtins.fromJSON (builtins.readFile ./src-deps.json));
+
srcs = lib.importJSON ./src-deps.json;
toFetchurl = d: lib.attrsets.nameValuePair d.name (fetchurl {
urls = d.urls;
sha256 = d.sha256;
+1 -1
pkgs/development/tools/build-managers/bazel/bazel_4/default.nix
···
srcDeps = lib.attrsets.attrValues srcDepsSet;
srcDepsSet =
let
-
srcs = (builtins.fromJSON (builtins.readFile ./src-deps.json));
+
srcs = lib.importJSON ./src-deps.json;
toFetchurl = d: lib.attrsets.nameValuePair d.name (fetchurl {
urls = d.urls;
sha256 = d.sha256;
+1 -1
pkgs/development/tools/parsing/tree-sitter/default.nix
···
mkdir $out
'' + (lib.concatStrings (lib.mapAttrsToList
(name: grammar: "ln -s ${fetchGrammar grammar} $out/${name}\n")
-
(import ./grammars))));
+
(import ./grammars { inherit lib; }))));
builtGrammars =
let
+49 -47
pkgs/development/tools/parsing/tree-sitter/grammars/default.nix
···
+
{ lib }:
+
{
-
tree-sitter-agda = (builtins.fromJSON (builtins.readFile ./tree-sitter-agda.json));
-
tree-sitter-bash = (builtins.fromJSON (builtins.readFile ./tree-sitter-bash.json));
-
tree-sitter-c = (builtins.fromJSON (builtins.readFile ./tree-sitter-c.json));
-
tree-sitter-c-sharp = (builtins.fromJSON (builtins.readFile ./tree-sitter-c-sharp.json));
-
tree-sitter-clojure = (builtins.fromJSON (builtins.readFile ./tree-sitter-clojure.json));
-
tree-sitter-comment = (builtins.fromJSON (builtins.readFile ./tree-sitter-comment.json));
-
tree-sitter-cpp = (builtins.fromJSON (builtins.readFile ./tree-sitter-cpp.json));
-
tree-sitter-css = (builtins.fromJSON (builtins.readFile ./tree-sitter-css.json));
-
tree-sitter-dart = (builtins.fromJSON (builtins.readFile ./tree-sitter-dart.json));
-
tree-sitter-dot = (builtins.fromJSON (builtins.readFile ./tree-sitter-dot.json));
-
tree-sitter-elisp = (builtins.fromJSON (builtins.readFile ./tree-sitter-elisp.json));
-
tree-sitter-embedded-template = (builtins.fromJSON (builtins.readFile ./tree-sitter-embedded-template.json));
-
tree-sitter-fennel = (builtins.fromJSON (builtins.readFile ./tree-sitter-fennel.json));
-
tree-sitter-fish = (builtins.fromJSON (builtins.readFile ./tree-sitter-fish.json));
-
tree-sitter-fluent = (builtins.fromJSON (builtins.readFile ./tree-sitter-fluent.json));
-
tree-sitter-go = (builtins.fromJSON (builtins.readFile ./tree-sitter-go.json));
-
tree-sitter-haskell = (builtins.fromJSON (builtins.readFile ./tree-sitter-haskell.json));
-
tree-sitter-html = (builtins.fromJSON (builtins.readFile ./tree-sitter-html.json));
-
tree-sitter-java = (builtins.fromJSON (builtins.readFile ./tree-sitter-java.json));
-
tree-sitter-javascript = (builtins.fromJSON (builtins.readFile ./tree-sitter-javascript.json));
-
tree-sitter-jsdoc = (builtins.fromJSON (builtins.readFile ./tree-sitter-jsdoc.json));
-
tree-sitter-json = (builtins.fromJSON (builtins.readFile ./tree-sitter-json.json));
-
tree-sitter-julia = (builtins.fromJSON (builtins.readFile ./tree-sitter-julia.json));
-
tree-sitter-latex = (builtins.fromJSON (builtins.readFile ./tree-sitter-latex.json));
-
tree-sitter-lua = (builtins.fromJSON (builtins.readFile ./tree-sitter-lua.json));
-
tree-sitter-make = (builtins.fromJSON (builtins.readFile ./tree-sitter-make.json));
-
tree-sitter-markdown = (builtins.fromJSON (builtins.readFile ./tree-sitter-markdown.json));
-
tree-sitter-nix = (builtins.fromJSON (builtins.readFile ./tree-sitter-nix.json));
-
tree-sitter-norg = (builtins.fromJSON (builtins.readFile ./tree-sitter-norg.json));
-
tree-sitter-ocaml = (builtins.fromJSON (builtins.readFile ./tree-sitter-ocaml.json));
-
tree-sitter-php = (builtins.fromJSON (builtins.readFile ./tree-sitter-php.json));
-
tree-sitter-python = (builtins.fromJSON (builtins.readFile ./tree-sitter-python.json));
-
tree-sitter-ql = (builtins.fromJSON (builtins.readFile ./tree-sitter-ql.json));
-
tree-sitter-regex = (builtins.fromJSON (builtins.readFile ./tree-sitter-regex.json));
-
tree-sitter-rst = (builtins.fromJSON (builtins.readFile ./tree-sitter-rst.json));
-
tree-sitter-ruby = (builtins.fromJSON (builtins.readFile ./tree-sitter-ruby.json));
-
tree-sitter-rust = (builtins.fromJSON (builtins.readFile ./tree-sitter-rust.json));
-
tree-sitter-scala = (builtins.fromJSON (builtins.readFile ./tree-sitter-scala.json));
-
tree-sitter-svelte = (builtins.fromJSON (builtins.readFile ./tree-sitter-svelte.json));
-
tree-sitter-swift = (builtins.fromJSON (builtins.readFile ./tree-sitter-swift.json));
-
tree-sitter-toml = (builtins.fromJSON (builtins.readFile ./tree-sitter-toml.json));
-
tree-sitter-tsq = (builtins.fromJSON (builtins.readFile ./tree-sitter-tsq.json));
-
tree-sitter-typescript = (builtins.fromJSON (builtins.readFile ./tree-sitter-typescript.json));
-
tree-sitter-verilog = (builtins.fromJSON (builtins.readFile ./tree-sitter-verilog.json));
-
tree-sitter-vim = (builtins.fromJSON (builtins.readFile ./tree-sitter-vim.json));
-
tree-sitter-yaml = (builtins.fromJSON (builtins.readFile ./tree-sitter-yaml.json));
-
tree-sitter-zig = (builtins.fromJSON (builtins.readFile ./tree-sitter-zig.json));
+
tree-sitter-agda = lib.importJSON ./tree-sitter-agda.json;
+
tree-sitter-bash = lib.importJSON ./tree-sitter-bash.json;
+
tree-sitter-c = lib.importJSON ./tree-sitter-c.json;
+
tree-sitter-c-sharp = lib.importJSON ./tree-sitter-c-sharp.json;
+
tree-sitter-clojure = lib.importJSON ./tree-sitter-clojure.json;
+
tree-sitter-comment = lib.importJSON ./tree-sitter-comment.json;
+
tree-sitter-cpp = lib.importJSON ./tree-sitter-cpp.json;
+
tree-sitter-css = lib.importJSON ./tree-sitter-css.json;
+
tree-sitter-dart = lib.importJSON ./tree-sitter-dart.json;
+
tree-sitter-dot = lib.importJSON ./tree-sitter-dot.json;
+
tree-sitter-elisp = lib.importJSON ./tree-sitter-elisp.json;
+
tree-sitter-embedded-template = lib.importJSON ./tree-sitter-embedded-template.json;
+
tree-sitter-fennel = lib.importJSON ./tree-sitter-fennel.json;
+
tree-sitter-fish = lib.importJSON ./tree-sitter-fish.json;
+
tree-sitter-fluent = lib.importJSON ./tree-sitter-fluent.json;
+
tree-sitter-go = lib.importJSON ./tree-sitter-go.json;
+
tree-sitter-haskell = lib.importJSON ./tree-sitter-haskell.json;
+
tree-sitter-html = lib.importJSON ./tree-sitter-html.json;
+
tree-sitter-java = lib.importJSON ./tree-sitter-java.json;
+
tree-sitter-javascript = lib.importJSON ./tree-sitter-javascript.json;
+
tree-sitter-jsdoc = lib.importJSON ./tree-sitter-jsdoc.json;
+
tree-sitter-json = lib.importJSON ./tree-sitter-json.json;
+
tree-sitter-julia = lib.importJSON ./tree-sitter-julia.json;
+
tree-sitter-latex = lib.importJSON ./tree-sitter-latex.json;
+
tree-sitter-lua = lib.importJSON ./tree-sitter-lua.json;
+
tree-sitter-make = lib.importJSON ./tree-sitter-make.json;
+
tree-sitter-markdown = lib.importJSON ./tree-sitter-markdown.json;
+
tree-sitter-nix = lib.importJSON ./tree-sitter-nix.json;
+
tree-sitter-norg = lib.importJSON ./tree-sitter-norg.json;
+
tree-sitter-ocaml = lib.importJSON ./tree-sitter-ocaml.json;
+
tree-sitter-php = lib.importJSON ./tree-sitter-php.json;
+
tree-sitter-python = lib.importJSON ./tree-sitter-python.json;
+
tree-sitter-ql = lib.importJSON ./tree-sitter-ql.json;
+
tree-sitter-regex = lib.importJSON ./tree-sitter-regex.json;
+
tree-sitter-rst = lib.importJSON ./tree-sitter-rst.json;
+
tree-sitter-ruby = lib.importJSON ./tree-sitter-ruby.json;
+
tree-sitter-rust = lib.importJSON ./tree-sitter-rust.json;
+
tree-sitter-scala = lib.importJSON ./tree-sitter-scala.json;
+
tree-sitter-svelte = lib.importJSON ./tree-sitter-svelte.json;
+
tree-sitter-swift = lib.importJSON ./tree-sitter-swift.json;
+
tree-sitter-toml = lib.importJSON ./tree-sitter-toml.json;
+
tree-sitter-tsq = lib.importJSON ./tree-sitter-tsq.json;
+
tree-sitter-typescript = lib.importJSON ./tree-sitter-typescript.json;
+
tree-sitter-verilog = lib.importJSON ./tree-sitter-verilog.json;
+
tree-sitter-vim = lib.importJSON ./tree-sitter-vim.json;
+
tree-sitter-yaml = lib.importJSON ./tree-sitter-yaml.json;
+
tree-sitter-zig = lib.importJSON ./tree-sitter-zig.json;
}
+1 -1
pkgs/development/tools/parsing/tree-sitter/update.nix
···
${foreachSh allGrammars
({name, ...}: ''
# indentation hack
-
printf " %s = (builtins.fromJSON (builtins.readFile ./%s.json));\n" "${name}" "${name}"'')}
+
printf " %s = lib.importJSON ./%s.json;\n" "${name}" "${name}"'')}
echo "}" ) \
> "$outputDir/default.nix"
'';
+1 -1
pkgs/development/web/netlify-cli/default.nix
···
preRebuild = ''
export ESBUILD_BINARY_PATH="${pkgs.esbuild_netlify}/bin/esbuild"
'';
-
src = fetchFromGitHub (builtins.fromJSON (builtins.readFile ./netlify-cli.json));
+
src = fetchFromGitHub (lib.importJSON ./netlify-cli.json);
bypassCache = true;
reconstructLock = true;
passthru.tests.test = callPackage ./test.nix { };
+1 -1
pkgs/development/web/netlify-cli/generate.sh
···
set -eu -o pipefail
cd "$( dirname "${BASH_SOURCE[0]}" )"
rm -f ./node-env.nix
-
src="$(nix-build --expr '(import ../../../.. {}).fetchFromGitHub (builtins.fromJSON (builtins.readFile ./netlify-cli.json))')"
+
src="$(nix-build --expr '(import ../../../.. {}).fetchFromGitHub (lib.importJSON ./netlify-cli.json)')"
echo $src
node2nix \
--input $src/package.json \
+1 -1
pkgs/games/dwarf-fortress/default.nix
···
(lib.attrNames self.df-hashes));
self = rec {
-
df-hashes = builtins.fromJSON (builtins.readFile ./game.json);
+
df-hashes = lib.importJSON ./game.json;
# Aliases for the latest Dwarf Fortress and the selected Therapist install
dwarf-fortress = getAttr (versionToName latestVersion) df-games;
+1 -1
pkgs/misc/vim-plugins/aliases.nix
···
deprecations = lib.mapAttrs (old: info:
throw "${old} was renamed to ${info.new} on ${info.date}. Please update to ${info.new}."
-
) (builtins.fromJSON (builtins.readFile ./deprecated.json));
+
) (lib.importJSON ./deprecated.json);
in
mapAliases (with prev; {
+1 -1
pkgs/misc/vscode-extensions/ms-dotnettools-csharp/default.nix
···
let
# Get as close as possible as the `package.json` required version.
# This is what drives omnisharp.
-
rtDepsSrcsFromJson = builtins.fromJSON (builtins.readFile ./rt-deps-bin-srcs.json);
+
rtDepsSrcsFromJson = lib.importJSON ./rt-deps-bin-srcs.json;
rtDepsBinSrcs = builtins.mapAttrs (k: v:
let
+1 -1
pkgs/os-specific/linux/kernel/patches.nix
···
extra = src.extra;
inherit version sha256;
};
-
patches = builtins.fromJSON (builtins.readFile ./hardened/patches.json);
+
patches = lib.importJSON ./hardened/patches.json;
in lib.mapAttrs mkPatch patches;
# https://bugzilla.kernel.org/show_bug.cgi?id=197591#c6
+1 -1
pkgs/servers/asterisk/default.nix
···
"externals_cache/pjproject-2.10.tar.bz2" = pjproject_2_10;
"addons/mp3" = mp3-202;
};
-
}) (builtins.fromJSON (builtins.readFile ./versions.json));
+
}) (lib.importJSON ./versions.json);
in {
# Supported releases (as of 2020-10-26).
+1 -1
pkgs/servers/web-apps/hedgedoc/default.nix
···
}:
let
-
pinData = (builtins.fromJSON (builtins.readFile ./pin.json));
+
pinData = lib.importJSON ./pin.json;
# we need a different version than the one already available in nixpkgs
esbuild-hedgedoc = buildGoModule rec {
+1 -1
pkgs/tools/networking/ngrok-2/default.nix
···
with lib;
-
let versions = builtins.fromJSON (builtins.readFile ./versions.json);
+
let versions = lib.importJSON ./versions.json;
arch = if stdenv.isi686 then "386"
else if stdenv.isx86_64 then "amd64"
else if stdenv.isAarch32 then "arm"
+1 -1
pkgs/tools/security/enpass/default.nix
···
}:
let
-
all_data = builtins.fromJSON (builtins.readFile ./data.json);
+
all_data = lib.importJSON ./data.json;
system_map = {
# i686-linux = "i386"; Uncomment if enpass 6 becomes available on i386
x86_64-linux = "amd64";
+1 -1
pkgs/tools/security/onlykey/default.nix
···
# parse the version from package.json
version =
let
-
packageJson = builtins.fromJSON (builtins.readFile ./package.json);
+
packageJson = lib.importJSON ./package.json;
splits = builtins.split "^.*#v(.*)$" (builtins.getAttr "onlykey" (builtins.head packageJson));
matches = builtins.elemAt splits 1;
elem = builtins.head matches;
+1 -1
pkgs/tools/text/chroma/default.nix
···
{ lib, buildGoModule, fetchFromGitHub }:
let
-
srcInfo = builtins.fromJSON (builtins.readFile ./src.json);
+
srcInfo = lib.importJSON ./src.json;
in
buildGoModule rec {
+12 -12
pkgs/top-level/all-packages.nix
···
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
-
adoptopenjdk-bin-16-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk16-linux.nix;
-
adoptopenjdk-bin-16-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk16-darwin.nix;
+
adoptopenjdk-bin-16-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk16-linux.nix { inherit lib; };
+
adoptopenjdk-bin-16-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk16-darwin.nix { inherit lib; };
adoptopenjdk-hotspot-bin-16 = if stdenv.isLinux
then callPackage adoptopenjdk-bin-16-packages-linux.jdk-hotspot {}
···
then callPackage adoptopenjdk-bin-16-packages-linux.jre-openj9 {}
else callPackage adoptopenjdk-bin-16-packages-darwin.jre-openj9 {};
-
adoptopenjdk-bin-15-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk15-linux.nix;
-
adoptopenjdk-bin-15-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk15-darwin.nix;
+
adoptopenjdk-bin-15-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk15-linux.nix { inherit lib; };
+
adoptopenjdk-bin-15-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk15-darwin.nix { inherit lib; };
adoptopenjdk-hotspot-bin-15 = if stdenv.isLinux
then callPackage adoptopenjdk-bin-15-packages-linux.jdk-hotspot {}
···
then callPackage adoptopenjdk-bin-15-packages-linux.jre-openj9 {}
else callPackage adoptopenjdk-bin-15-packages-darwin.jre-openj9 {};
-
adoptopenjdk-bin-14-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk14-linux.nix;
-
adoptopenjdk-bin-14-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk14-darwin.nix;
+
adoptopenjdk-bin-14-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk14-linux.nix { inherit lib; };
+
adoptopenjdk-bin-14-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk14-darwin.nix { inherit lib; };
adoptopenjdk-hotspot-bin-14 = if stdenv.isLinux
then callPackage adoptopenjdk-bin-14-packages-linux.jdk-hotspot {}
···
then callPackage adoptopenjdk-bin-14-packages-linux.jre-openj9 {}
else callPackage adoptopenjdk-bin-14-packages-darwin.jre-openj9 {};
-
adoptopenjdk-bin-13-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk13-linux.nix;
-
adoptopenjdk-bin-13-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk13-darwin.nix;
+
adoptopenjdk-bin-13-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk13-linux.nix { inherit lib; };
+
adoptopenjdk-bin-13-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk13-darwin.nix { inherit lib; };
adoptopenjdk-hotspot-bin-13 = if stdenv.isLinux
then callPackage adoptopenjdk-bin-13-packages-linux.jdk-hotspot {}
···
then callPackage adoptopenjdk-bin-13-packages-linux.jre-openj9 {}
else callPackage adoptopenjdk-bin-13-packages-darwin.jre-openj9 {};
-
adoptopenjdk-bin-11-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk11-linux.nix;
-
adoptopenjdk-bin-11-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk11-darwin.nix;
+
adoptopenjdk-bin-11-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk11-linux.nix { inherit lib; };
+
adoptopenjdk-bin-11-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk11-darwin.nix { inherit lib; };
adoptopenjdk-hotspot-bin-11 = if stdenv.isLinux
then callPackage adoptopenjdk-bin-11-packages-linux.jdk-hotspot {}
···
then callPackage adoptopenjdk-bin-11-packages-linux.jre-openj9 {}
else callPackage adoptopenjdk-bin-11-packages-darwin.jre-openj9 {};
-
adoptopenjdk-bin-8-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk8-linux.nix;
-
adoptopenjdk-bin-8-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk8-darwin.nix;
+
adoptopenjdk-bin-8-packages-linux = import ../development/compilers/adoptopenjdk-bin/jdk8-linux.nix { inherit lib; };
+
adoptopenjdk-bin-8-packages-darwin = import ../development/compilers/adoptopenjdk-bin/jdk8-darwin.nix { inherit lib; };
adoptopenjdk-hotspot-bin-8 = if stdenv.isLinux
then callPackage adoptopenjdk-bin-8-packages-linux.jdk-hotspot {}