mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 06:19:00 +00:00
nixos/workflows: restructure enable option
The type is probably not apprioriate since I want to be able to install multiple of them at a given time but we'll see.
This commit is contained in:
parent
3bc011a3ed
commit
580e0ebe93
@ -1,12 +1,15 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.workflows.workflows.a-happy-gnome;
|
workflowName = "a-happy-gnome";
|
||||||
|
cfg = config.workflows.workflows.${workflowName};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.workflows.workflows.a-happy-gnome = {
|
options.workflows.enable = lib.mkOption {
|
||||||
enable = lib.mkEnableOption "'A happy GNOME', foo-dogsquared's configuration of GNOME desktop environment";
|
type = with lib.types; listOf (enum [ workflowName ]);
|
||||||
|
};
|
||||||
|
|
||||||
|
options.workflows.workflows.${workflowName} = {
|
||||||
shellExtensions = lib.mkOption {
|
shellExtensions = lib.mkOption {
|
||||||
type = with lib.types; listOf package;
|
type = with lib.types; listOf package;
|
||||||
description = ''
|
description = ''
|
||||||
@ -81,7 +84,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf (lib.elem workflowName config.workflows.enable) {
|
||||||
# Enable GNOME and GDM.
|
# Enable GNOME and GDM.
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
# Themes are your graphical sessions.
|
# Themes are your graphical sessions. It also contains your aesthetics even
|
||||||
# It also contains your aesthetics even specific workflow and whatnots.
|
# specific workflow and whatnots. You can also show your desktop being
|
||||||
# You can also show your desktop being modularized like this.
|
# modularized like this.
|
||||||
{ config, lib, pkgs, foodogsquaredLib, ... }:
|
{ lib, ... }:
|
||||||
|
|
||||||
let cfg = config.workflows;
|
{
|
||||||
in {
|
options.workflows.enable = lib.mkOption {
|
||||||
options.workflows.disableLimit = lib.mkOption {
|
type = with lib.types; listOf (enum [ ]);
|
||||||
type = lib.types.bool;
|
default = [ ];
|
||||||
default = false;
|
|
||||||
description = ''
|
description = ''
|
||||||
Whether to unlock the limit for workflows. Since workflows may overlap
|
A list of workflows to be enabled.
|
||||||
with packages and configurations, this should be enabled at your own
|
|
||||||
risk.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -19,15 +16,4 @@ in {
|
|||||||
./a-happy-gnome
|
./a-happy-gnome
|
||||||
./knome
|
./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.";
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.workflows.workflows.knome;
|
workflowName = "knome";
|
||||||
|
cfg = config.workflows.workflows.${workflowName};
|
||||||
in
|
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 = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
desktopManager.plasma5 = {
|
desktopManager.plasma5 = {
|
||||||
|
Loading…
Reference in New Issue
Block a user