clanServices: add desktop module

This commit is contained in:
pinpox
2025-10-13 12:38:50 +02:00
parent 7e00a08111
commit 42e3fea9e5
9 changed files with 113 additions and 5 deletions

View File

@@ -0,0 +1,28 @@
This module sets up the [KDE Plasma](https://kde.org) Desktop environment.
!!! Note "Customisation"
This service intentionally does not provide any settings or customisation
options, as desktop preferences are highly subjective. Clan currently
supports only this default desktop configuration. Any additional
customisation can be done via the `extraModules` option. Furthermore, if you
want to use a different desktop environment or compositor (e.g. Gnome or
sway), we encourage you to to build your own
[Clan Service](https://docs.clan.lol/guides/services/community/) or have a
look at the [Community Services](https://docs.clan.lol/services/community/).
## Example Usage
```nix
inventory = {
instances = {
kde = {
# Deploy on all machines
roles.default.tags.all = { };
# Or individual hosts
roles.default.machines.laptop = { };
};
};
};
```

View File

@@ -0,0 +1,18 @@
{ ... }:
{
_class = "clan.service";
manifest.name = "clan-core/kde";
manifest.description = "Sets up a graphical desktop environment";
manifest.categories = [ "Desktop" ];
roles.default = {
description = "KDE/Plasma (wayland): Full-featured desktop environment with modern Qt-based interface";
perInstance.nixosModule = {
services = {
displayManager.sddm.enable = true;
displayManager.sddm.wayland.enable = true;
desktopManager.plasma6.enable = true;
};
};
};
}

View File

@@ -0,0 +1,24 @@
{
self,
lib,
...
}:
let
module = lib.modules.importApply ./default.nix {
inherit (self) packages;
};
in
{
clan.modules = {
kde = module;
};
perSystem =
{ ... }:
{
clan.nixosTests.kde = {
imports = [ ./tests/vm/default.nix ];
clan.modules.kde = module;
};
};
}

View File

@@ -0,0 +1,30 @@
{
name = "kde";
clan = {
directory = ./.;
inventory = {
machines.client = { };
instances = {
kde = {
module.name = "kde";
module.input = "self";
roles.default.machines."client" = { };
};
};
};
};
testScript = ''
start_all()
client.systemctl("start network-online.target")
client.wait_for_unit("network-online.target")
client.wait_for_unit("graphical.target")
client.wait_for_unit("display-manager.service")
client.succeed("systemctl status display-manager.service")
'';
}

View File

@@ -0,0 +1,4 @@
{
"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"type": "age"
}

View File

@@ -165,6 +165,7 @@ nav:
- services/official/garage.md - services/official/garage.md
- services/official/hello-world.md - services/official/hello-world.md
- services/official/importer.md - services/official/importer.md
- services/official/kde.md
- services/official/localbackup.md - services/official/localbackup.md
- services/official/matrix-synapse.md - services/official/matrix-synapse.md
- services/official/mycelium.md - services/official/mycelium.md

View File

@@ -294,21 +294,22 @@ in
''; '';
type = types.listOf ( type = types.listOf (
types.enum [ types.enum [
"AudioVideo"
"Audio" "Audio"
"Video" "AudioVideo"
"Desktop"
"Development" "Development"
"Education" "Education"
"Game" "Game"
"Graphics" "Graphics"
"Social"
"Network" "Network"
"Office" "Office"
"Science" "Science"
"System"
"Settings" "Settings"
"Utility" "Social"
"System"
"Uncategorized" "Uncategorized"
"Utility"
"Video"
] ]
); );
}; };

View File

@@ -39,6 +39,7 @@ class ModuleManifest:
"Audio": {"color": "#CFCFC4", "description": "Audio"}, "Audio": {"color": "#CFCFC4", "description": "Audio"},
"Video": {"color": "#FFD1DC", "description": "Video"}, "Video": {"color": "#FFD1DC", "description": "Video"},
"Development": {"color": "#F49AC2", "description": "Development"}, "Development": {"color": "#F49AC2", "description": "Development"},
"Desktop": {"color": "#F4eeaa", "description": "Desktop Environment"},
"Education": {"color": "#B39EB5", "description": "Education"}, "Education": {"color": "#B39EB5", "description": "Education"},
"Game": {"color": "#FFB347", "description": "Game"}, "Game": {"color": "#FFB347", "description": "Game"},
"Graphics": {"color": "#FF6961", "description": "Graphics"}, "Graphics": {"color": "#FF6961", "description": "Graphics"},