32 lines
801 B
Nix
32 lines
801 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
inherit (lib) mkIf mkEnableOption mkOption types;
|
|
cfg = config.programs.culr;
|
|
in {
|
|
options.programs.culr = {
|
|
enable = mkEnableOption "culr";
|
|
pattern = mkOption {
|
|
type = with types; nullOr (either (listOf int) str);
|
|
default = null;
|
|
description = "colourising pattern";
|
|
};
|
|
palette = mkOption {
|
|
type = with types; nullOr (listOf str);
|
|
default = null;
|
|
description = "palette to use in comma separated RGB hex eg. #0f0f0f";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = let inherit (pkgs) culr; in [culr];
|
|
environment.sessionVariables = {
|
|
CULR_PATTERN = mkIf (cfg.pattern != null) cfg.pattern;
|
|
CULR_PALETTE = mkIf (cfg.palette != null) cfg.palette;
|
|
};
|
|
};
|
|
}
|