more work

This commit is contained in:
Chris Kruining 2025-07-24 09:57:59 +02:00
parent 30501b7fac
commit ef6c049068
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
36 changed files with 843 additions and 842 deletions

View file

@ -1,5 +1,6 @@
{ lib, config, namespace, ... }:let
inherit (lib) mkIf mkOption mkEnableOption mkMerge attrNames filterAttrs readDir;
{ lib, config, namespace, ... }:
let
inherit (lib) mkIf mkOption mkEnableOption mkMerge;
inherit (lib.types) nullOr enum;
cfg = config.${namespace}.desktop;
@ -7,7 +8,7 @@ in
{
options.${namespace}.desktop = {
use = mkOption {
type = nullOr enum (attrNames (filterAttrs (n: type: type == "directory") (readDir ./.)));
type = nullOr (enum [ "plasma" "gamescope" "gnome" ]);
default = null;
example = "plasma";
description = "Which desktop to enable";
@ -17,9 +18,7 @@ in
};
config = mkMerge [
(mkIf cfg.desktop != null {
"${namespace}".desktop.${cfg.use}.enable = true;
({
services.displayManager = {
enable = true;
@ -28,5 +27,9 @@ in
};
};
})
(mkIf (cfg.use != null) {
${namespace}.desktop.${cfg.use}.enable = true;
})
];
}