mirror of
https://github.com/NotAShelf/Basix.git
synced 2025-10-02 06:53:53 +00:00
flake: eval scheme data
This commit is contained in:
parent
e4dc9f586e
commit
edc9911f48
2 changed files with 20 additions and 25 deletions
26
flake.nix
26
flake.nix
|
@ -1,24 +1,36 @@
|
|||
{
|
||||
description = "Description for the project";
|
||||
description = "Base16/Base24 schemes for Nix";
|
||||
|
||||
inputs = {
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
schemes = {
|
||||
url = "github:tinted-theming/schemes";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {flake-parts, ...}:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
|
||||
perSystem = {pkgs, ...}: {
|
||||
# Example if we could make it a list:
|
||||
# builtins.mapAttrs (_: p: builtins.fromJSON (builtins.readFile p)) (import ./list.nix)
|
||||
packages = {
|
||||
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…
Add table
Add a link
Reference in a new issue