nixos-config/modules/nixos/workflows/default.nix
Gabriel Arazas 6cb1515d91 themes: rename into workflows
More self-descriptive == better. Plus it does imply that themes only
change aesthetics which is not often the case with the usual modules
that are defined here.
2022-08-27 13:41:12 +08:00

30 lines
936 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.workflows;
in {
options.workflows.disableLimit = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to unlock the limit for workflows. Since workflows 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.workflows;
in cfg.disableLimit || (enabledThemes <= 1);
message = "Can't have more than one theme enabled at any given time.";
}];
};
}