2023-02-10 07:46:37 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
options,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2023-01-31 09:38:11 +01:00
|
|
|
with lib; let
|
|
|
|
global = config.catppuccin;
|
|
|
|
cfg = config.catppuccin.dircolors;
|
|
|
|
# generated via vivid@HEAD - ./generate.sh
|
2023-02-10 07:46:37 +01:00
|
|
|
theme = flavour: trueColor:
|
|
|
|
builtins.fromJSON (
|
|
|
|
builtins.readFile
|
|
|
|
./catppuccin-${flavour
|
|
|
|
+ (
|
|
|
|
if trueColor
|
|
|
|
then ""
|
|
|
|
else "-8bit"
|
|
|
|
)}.json
|
|
|
|
);
|
|
|
|
in {
|
2023-01-31 09:38:11 +01:00
|
|
|
options.catppuccin = {
|
|
|
|
dircolors = {
|
|
|
|
enable = mkEnableOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Enable catppuccin for dircolors / lscolors";
|
|
|
|
};
|
|
|
|
theme = mkOption {
|
2023-02-10 07:46:37 +01:00
|
|
|
type = types.enum ["mocha" "macchiato" "frappe" "latte"];
|
2023-01-31 09:38:11 +01:00
|
|
|
default = global.defaultTheme;
|
|
|
|
description = "Choose a flavour for dircolors";
|
|
|
|
};
|
|
|
|
trueColor = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Use truecolor for dircolors";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
programs.dircolors = {
|
|
|
|
enable = true;
|
|
|
|
settings = theme cfg.theme (!cfg.trueColor);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|