treewide: format using nixfmt
Signed-off-by: Bloxx12 <charlie@charlieroot.dev> Change-Id: I6a6a69641c36f9763e104087a559c148d0449f00
This commit is contained in:
parent
f4464732e3
commit
e641dfa114
113 changed files with 1545 additions and 1019 deletions
|
@ -9,10 +9,24 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib.options) mkOption literalExpression;
|
||||
inherit (lib.strings) toLower replaceStrings removePrefix hasPrefix isString;
|
||||
inherit (lib.types) str nullOr enum mkOptionType attrsOf coercedTo;
|
||||
inherit (lib.strings)
|
||||
toLower
|
||||
replaceStrings
|
||||
removePrefix
|
||||
hasPrefix
|
||||
isString
|
||||
;
|
||||
inherit (lib.types)
|
||||
str
|
||||
nullOr
|
||||
enum
|
||||
mkOptionType
|
||||
attrsOf
|
||||
coercedTo
|
||||
;
|
||||
|
||||
cfg = config.modules.style;
|
||||
|
||||
|
@ -24,16 +38,24 @@
|
|||
};
|
||||
colorType = attrsOf (coercedTo str (removePrefix "#") hexColorType);
|
||||
|
||||
nameToSlug = name: toLower (replaceStrings [" "] ["-"] name);
|
||||
getPaletteFromScheme = slug:
|
||||
if builtins.pathExists ./palettes/${slug}.nix
|
||||
then (import ./palettes/${slug}.nix).colorscheme.palette
|
||||
else throw "The following colorscheme was imported but not found: ${slug}";
|
||||
in {
|
||||
nameToSlug = name: toLower (replaceStrings [ " " ] [ "-" ] name);
|
||||
getPaletteFromScheme =
|
||||
slug:
|
||||
if builtins.pathExists ./palettes/${slug}.nix then
|
||||
(import ./palettes/${slug}.nix).colorscheme.palette
|
||||
else
|
||||
throw "The following colorscheme was imported but not found: ${slug}";
|
||||
in
|
||||
{
|
||||
options.modules.style = {
|
||||
colorScheme = {
|
||||
name = mkOption {
|
||||
type = nullOr (enum ["Catppuccin Mocha" "Zenburn" "Black Metal Venom" "Gruvbox"]);
|
||||
type = nullOr (enum [
|
||||
"Catppuccin Mocha"
|
||||
"Zenburn"
|
||||
"Black Metal Venom"
|
||||
"Gruvbox"
|
||||
]);
|
||||
description = "The colorscheme that should be used globally to theme your system.";
|
||||
default = "Catppuccin Mocha";
|
||||
};
|
||||
|
@ -83,11 +105,11 @@ in {
|
|||
};
|
||||
|
||||
variant = mkOption {
|
||||
type = enum ["dark" "light"];
|
||||
default =
|
||||
if builtins.substring 0 1 cfg.colorScheme.colors.base00 < "5"
|
||||
then "dark"
|
||||
else "light";
|
||||
type = enum [
|
||||
"dark"
|
||||
"light"
|
||||
];
|
||||
default = if builtins.substring 0 1 cfg.colorScheme.colors.base00 < "5" then "dark" else "light";
|
||||
description = ''
|
||||
Whether the scheme is dark or light
|
||||
'';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue