nixos-config/modules/nixos/themes/default.nix
Gabriel Arazas 6b481a163a Restructure the modules
While it is easier to maintain the modules by prefixing them all with
`modules`, it is not easy when used from other flakes and/or modules.
This is my attempt on making it easier with appropriate namespaces.

Update home-manager user from the restructure
2022-01-09 19:44:09 +08:00

29 lines
914 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.themes;
in {
options.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.";
}];
};
}