mirror of
https://github.com/NotAShelf/Basix.git
synced 2024-11-22 08:20:42 +00:00
flake: eval scheme data
This commit is contained in:
parent
e4dc9f586e
commit
edc9911f48
2 changed files with 20 additions and 25 deletions
19
flake.lock
19
flake.lock
|
@ -49,24 +49,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs"
|
||||||
"schemes": "schemes"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"schemes": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1713388094,
|
|
||||||
"narHash": "sha256-wcotm0Ek2ISn8iJBzEujJQdcPLKWrPAOZ/dS/DLKafw=",
|
|
||||||
"owner": "tinted-theming",
|
|
||||||
"repo": "schemes",
|
|
||||||
"rev": "abcf2a055ae69f1bf047463332f83db3125aa8a5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "tinted-theming",
|
|
||||||
"repo": "schemes",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
26
flake.nix
26
flake.nix
|
@ -1,24 +1,36 @@
|
||||||
{
|
{
|
||||||
description = "Description for the project";
|
description = "Base16/Base24 schemes for Nix";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
schemes = {
|
|
||||||
url = "github:tinted-theming/schemes";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {flake-parts, ...}:
|
outputs = inputs @ {flake-parts, ...}:
|
||||||
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, ...}: {
|
||||||
# Example if we could make it a list:
|
|
||||||
# builtins.mapAttrs (_: p: builtins.fromJSON (builtins.readFile p)) (import ./list.nix)
|
|
||||||
packages = {
|
packages = {
|
||||||
convert-scheme = pkgs.callPackage ./packages/convert-scheme/package.nix {};
|
convert-scheme = pkgs.callPackage ./packages/convert-scheme/package.nix {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
flake = let
|
||||||
|
inherit (inputs.nixpkgs) lib;
|
||||||
|
evalSchemeData = x:
|
||||||
|
(lib.mapAttrs' (
|
||||||
|
n: v:
|
||||||
|
lib.optionalAttrs (v == "regular" && lib.hasSuffix ".json" n) {
|
||||||
|
name = lib.removeSuffix ".json" n;
|
||||||
|
value = x + n;
|
||||||
|
}
|
||||||
|
))
|
||||||
|
(builtins.readDir x);
|
||||||
|
in {
|
||||||
|
schemeData = {
|
||||||
|
base16 = evalSchemeData ./json/base16;
|
||||||
|
base24 = evalSchemeData ./json/base24;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue