mirror of
https://github.com/NotAShelf/Basix.git
synced 2024-11-22 16:30:42 +00:00
schizo json import function
This commit is contained in:
parent
edc9911f48
commit
f01928e0ff
1 changed files with 13 additions and 12 deletions
25
flake.nix
25
flake.nix
|
@ -6,7 +6,7 @@
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {flake-parts, ...}:
|
outputs = inputs @ {flake-parts, self, ...}:
|
||||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
||||||
perSystem = {pkgs, ...}: {
|
perSystem = {pkgs, ...}: {
|
||||||
|
@ -17,19 +17,20 @@
|
||||||
|
|
||||||
flake = let
|
flake = let
|
||||||
inherit (inputs.nixpkgs) lib;
|
inherit (inputs.nixpkgs) lib;
|
||||||
evalSchemeData = x:
|
evalSchemeData = lib.flip lib.pipe [
|
||||||
(lib.mapAttrs' (
|
builtins.unsafeDiscardStringContext
|
||||||
n: v:
|
lib.filesystem.listFilesRecursive
|
||||||
lib.optionalAttrs (v == "regular" && lib.hasSuffix ".json" n) {
|
(builtins.filter (lib.hasSuffix ".json"))
|
||||||
name = lib.removeSuffix ".json" n;
|
(map (n: {
|
||||||
value = x + n;
|
name = lib.removePrefix ((dirOf n) + "/") (lib.removeSuffix ".json" n);
|
||||||
}
|
value = lib.importJSON n;
|
||||||
))
|
}))
|
||||||
(builtins.readDir x);
|
lib.listToAttrs
|
||||||
|
];
|
||||||
in {
|
in {
|
||||||
schemeData = {
|
schemeData = {
|
||||||
base16 = evalSchemeData ./json/base16;
|
base16 = evalSchemeData "${self}/json/base16";
|
||||||
base24 = evalSchemeData ./json/base24;
|
base24 = evalSchemeData "${self}/json/base24";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue