mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 16:57:55 +00:00
6d33406492
Setting themes should be in `modules.themes.themes` for namespacing and the module itself is gaining options.
29 lines
930 B
Nix
29 lines
930 B
Nix
# 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.
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
let cfg = config.modules.themes;
|
|
in {
|
|
options.modules.themes.disableLimit = lib.mkOption {
|
|
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.
|
|
'';
|
|
};
|
|
|
|
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.";
|
|
}];
|
|
};
|
|
}
|