1

Modules: Remove the options to disable paths and color modules

This commit is contained in:
2025-07-09 03:09:21 +02:00
parent cb3e132345
commit b012f42a95
4 changed files with 35 additions and 40 deletions

View File

@ -18,46 +18,45 @@ in {
mkColorAssignment = defs: key: {${key} = defs.${key};}; mkColorAssignment = defs: key: {${key} = defs.${key};};
mkRgbColorAssignment = defs: key: {${key} = mylib.color.hexToRGB defs.${key};}; mkRgbColorAssignment = defs: key: {${key} = mylib.color.hexToRGB defs.${key};};
mkRgbStringColorAssignment = defs: key: {${key} = mylib.color.hexToRGBString "," defs.${key};}; mkRgbStringColorAssignment = defs: key: {${key} = mylib.color.hexToRGBString "," defs.${key};};
in in {
lib.mkIf color.enable { # This module sets its own options
# This module sets its own options # to the values specified in a colorscheme file.
# to the values specified in a colorscheme file. modules.color = {
modules.color = { hex = {
hex = { light = lib.pipe colorKeys [
light = lib.pipe colorKeys [ (builtins.map (mkColorAssignment lightDefs))
(builtins.map (mkColorAssignment lightDefs)) lib.mergeAttrsList
lib.mergeAttrsList ];
];
dark = lib.pipe colorKeys [ dark = lib.pipe colorKeys [
(builtins.map (mkColorAssignment darkDefs)) (builtins.map (mkColorAssignment darkDefs))
lib.mergeAttrsList lib.mergeAttrsList
]; ];
}; };
rgb = { rgb = {
light = lib.pipe colorKeys [ light = lib.pipe colorKeys [
(builtins.map (mkRgbColorAssignment lightDefs)) (builtins.map (mkRgbColorAssignment lightDefs))
lib.mergeAttrsList lib.mergeAttrsList
]; ];
dark = lib.pipe colorKeys [ dark = lib.pipe colorKeys [
(builtins.map (mkRgbColorAssignment darkDefs)) (builtins.map (mkRgbColorAssignment darkDefs))
lib.mergeAttrsList lib.mergeAttrsList
]; ];
}; };
rgbString = { rgbString = {
light = lib.pipe colorKeys [ light = lib.pipe colorKeys [
(builtins.map (mkRgbStringColorAssignment lightDefs)) (builtins.map (mkRgbStringColorAssignment lightDefs))
lib.mergeAttrsList lib.mergeAttrsList
]; ];
dark = lib.pipe colorKeys [ dark = lib.pipe colorKeys [
(builtins.map (mkRgbStringColorAssignment darkDefs)) (builtins.map (mkRgbStringColorAssignment darkDefs))
lib.mergeAttrsList lib.mergeAttrsList
]; ];
};
}; };
}; };
};
} }

View File

@ -5,8 +5,6 @@
}: }:
with lib; with lib;
with mylib.modules; { with mylib.modules; {
enable = mkEnableOption "Enable color schemes";
lightScheme = mkOption { lightScheme = mkOption {
type = types.str; type = types.str;
description = "The color scheme to use for light colors"; description = "The color scheme to use for light colors";

View File

@ -11,5 +11,5 @@ in {
# The paths module doesn't use the "modules" namespace to keep the access shorter # The paths module doesn't use the "modules" namespace to keep the access shorter
options.paths = import ./options.nix {inherit lib mylib;}; options.paths = import ./options.nix {inherit lib mylib;};
config = lib.mkIf paths.enable {}; config = {};
} }

View File

@ -5,8 +5,6 @@
}: }:
with lib; with lib;
with mylib.modules; { with mylib.modules; {
enable = mkEnableOption "paths";
nixflake = lib.mkOption { nixflake = lib.mkOption {
type = lib.types.path; type = lib.types.path;
apply = toString; apply = toString;