Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
use lib.importJSON instead of reimplementing it
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelr authored and K900 committed Jan 10, 2024
1 parent 848a45a commit ee296ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions pkgs/kde/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
gear = import ./gear {inherit (self) callPackage;};
plasma = import ./plasma {inherit (self) callPackage;};

readJson = f: builtins.fromJSON (builtins.readFile f);
sets = ["gear" "frameworks" "plasma"];

loadUrls = set: readJson (./generated/sources + "/${set}.json");
loadUrls = set: lib.importJSON (./generated/sources + "/${set}.json");
allUrls = lib.attrsets.mergeAttrsList (map loadUrls sets);

sources = lib.mapAttrs (_: v:
Expand Down
7 changes: 3 additions & 4 deletions pkgs/kde/lib/mk-kde-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ self: {
cmake,
qt6,
}: let
readJson = f: builtins.fromJSON (builtins.readFile f);
dependencies = (readJson ../generated/dependencies.json).dependencies;
projectInfo = readJson ../generated/projects.json;
dependencies = (lib.importJSON ../generated/dependencies.json).dependencies;
projectInfo = lib.importJSON ../generated/projects.json;

licenseInfo = readJson ../generated/licenses.json;
licenseInfo = lib.importJSON ../generated/licenses.json;
licensesBySpdxId =
(lib.mapAttrs' (_: v: {
name = v.spdxId or "unknown";
Expand Down

0 comments on commit ee296ca

Please sign in to comment.