diff --git a/modules/nixos/_private/workflows/a-happy-gnome/default.nix b/modules/nixos/_private/workflows/a-happy-gnome/default.nix index 4c5e8628..06794452 100644 --- a/modules/nixos/_private/workflows/a-happy-gnome/default.nix +++ b/modules/nixos/_private/workflows/a-happy-gnome/default.nix @@ -1,12 +1,15 @@ { config, lib, pkgs, ... }: let - cfg = config.workflows.workflows.a-happy-gnome; + workflowName = "a-happy-gnome"; + cfg = config.workflows.workflows.${workflowName}; in { - options.workflows.workflows.a-happy-gnome = { - enable = lib.mkEnableOption "'A happy GNOME', foo-dogsquared's configuration of GNOME desktop environment"; + options.workflows.enable = lib.mkOption { + type = with lib.types; listOf (enum [ workflowName ]); + }; + options.workflows.workflows.${workflowName} = { shellExtensions = lib.mkOption { type = with lib.types; listOf package; description = '' @@ -81,7 +84,7 @@ in }; }; - config = lib.mkIf cfg.enable { + config = lib.mkIf (lib.elem workflowName config.workflows.enable) { # Enable GNOME and GDM. services.xserver = { enable = true; diff --git a/modules/nixos/_private/workflows/default.nix b/modules/nixos/_private/workflows/default.nix index 0e98dc76..e9d87236 100644 --- a/modules/nixos/_private/workflows/default.nix +++ b/modules/nixos/_private/workflows/default.nix @@ -1,17 +1,14 @@ -# 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, lib, pkgs, foodogsquaredLib, ... }: +# 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. +{ lib, ... }: -let cfg = config.workflows; -in { - options.workflows.disableLimit = lib.mkOption { - type = lib.types.bool; - default = false; +{ + options.workflows.enable = lib.mkOption { + type = with lib.types; listOf (enum [ ]); + default = [ ]; description = '' - Whether to unlock the limit for workflows. Since workflows may overlap - with packages and configurations, this should be enabled at your own - risk. + A list of workflows to be enabled. ''; }; @@ -19,15 +16,4 @@ in { ./a-happy-gnome ./knome ]; - - config = { - assertions = [{ - assertion = - let - enabledThemes = foodogsquaredLib.countAttrs (_: theme: theme.enable) cfg.workflows; - in - cfg.disableLimit || (enabledThemes <= 1); - message = "Can't have more than one theme enabled at any given time."; - }]; - }; } diff --git a/modules/nixos/_private/workflows/knome/default.nix b/modules/nixos/_private/workflows/knome/default.nix index 3ac7f61b..11bf9623 100644 --- a/modules/nixos/_private/workflows/knome/default.nix +++ b/modules/nixos/_private/workflows/knome/default.nix @@ -1,12 +1,15 @@ { config, lib, pkgs, ... }: let - cfg = config.workflows.workflows.knome; + workflowName = "knome"; + cfg = config.workflows.workflows.${workflowName}; in { - options.workflows.workflows.knome.enable = lib.mkEnableOption "KNOME, an attempt to bring as much GNOME to KDE Plasma"; + options.workflows.enable = lib.mkOption { + type = with lib.types; listOf (enum [ workflowName ]); + }; - config = lib.mkIf cfg.enable { + config = lib.mkIf (lib.elem workflowName config.workflows.enable) { services.xserver = { enable = true; desktopManager.plasma5 = {