2021-11-25 11:55:30 +00:00
|
|
|
# Themes are your graphical sessions.
|
|
|
|
# It also contains your aesthetics even specific workflow and whatnots.
|
|
|
|
# You can also show your desktop being modularized like this.
|
2020-08-16 08:33:44 +00:00
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
2022-01-09 05:38:59 +00:00
|
|
|
let cfg = config.themes;
|
2021-12-25 12:32:52 +00:00
|
|
|
in {
|
2022-01-09 05:38:59 +00:00
|
|
|
options.themes.disableLimit = lib.mkOption {
|
2021-12-25 12:32:52 +00:00
|
|
|
type = lib.types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to unlock the limit for themes. Since themes may overlap with
|
|
|
|
packages and configurations, this should be enabled at your own risk.
|
|
|
|
'';
|
|
|
|
};
|
2020-10-20 15:56:10 +00:00
|
|
|
|
2021-12-25 12:32:52 +00:00
|
|
|
imports = lib.mapAttrsToList (n: v: import v)
|
|
|
|
(lib.filterAttrs (n: v: n != "default") (lib.filesToAttr ./.));
|
|
|
|
|
|
|
|
config = {
|
|
|
|
assertions = [{
|
|
|
|
assertion =
|
|
|
|
let enabledThemes = lib.countAttrs (_: theme: theme.enable) cfg.themes;
|
|
|
|
in cfg.disableLimit && (enabledThemes < 2);
|
|
|
|
message = "Can't have more than one theme enabled at any given time.";
|
|
|
|
}];
|
|
|
|
};
|
2020-08-16 08:33:44 +00:00
|
|
|
}
|