1
Fork 0
mirror of https://github.com/RGBCube/ThemeNix synced 2025-07-28 17:07:46 +00:00

Make slugs only exist in runtime, add info fields to theme.<name>.withHashtag.{name, author}, fix templates issue

This commit is contained in:
RGBCube 2023-11-26 22:57:44 +03:00
parent 8dad0349c4
commit 4d4ec5a91b
No known key found for this signature in database
253 changed files with 17 additions and 265 deletions

View file

@ -1,7 +1,7 @@
{
description = "Theme your NixOS configuration consistently.";
outputs = { self }: builtins.mapAttrs (_: theme: let
outputs = { self }: builtins.mapAttrs (slug: theme: let
themeDescriptiveNames = with theme; {
background = base00;
lighterBackground = base01;
@ -50,17 +50,21 @@
openingClosingEmbeddedLanguageTag = base0F;
};
enrichedTheme = theme // themeDescriptiveNames;
enrichedThemeOnlyColors = builtins.removeAttrs enrichedTheme [ "name" "author" ];
enrichedThemeHelpers = {
with0x = builtins.mapAttrs (_: value: "0x" + value) enrichedThemeOnlyColors;
withHashtag = builtins.mapAttrs (_: value: "#" + value) enrichedThemeOnlyColors;
themeWithSlug = theme // {
inherit slug;
};
templates = builtins.mapAttrs (_: value: {
tmTheme = (import ./templates/tmTheme.nix) value;
}) enrichedTheme;
enrichedTheme = themeWithSlug // themeDescriptiveNames;
enrichedThemeOnlyColors = builtins.removeAttrs enrichedTheme [ "name" "author" "slug" ];
enrichedThemeHelpers = {
with0x = builtins.mapAttrs (_: value: "0x" + value) (enrichedTheme // enrichedThemeOnlyColors);
withHashtag = builtins.mapAttrs (_: value: "#" + value) (enrichedTheme // enrichedThemeOnlyColors);
};
templates = {
tmTheme = (import ./templates/tmTheme.nix) theme;
};
in enrichedTheme // enrichedThemeHelpers // templates) (import ./themes.nix);
}