made some progress

This commit is contained in:
Chris Kruining 2025-07-23 16:12:13 +02:00
parent 5ba5d55108
commit a9a4777168
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
35 changed files with 1176 additions and 44 deletions

View file

@ -0,0 +1,37 @@
{ lib, config, namespace, ... }:let
inherit (lib) mkOption mkMerge attrNames filterAttrs;
inherit (lib.types) nullOr enum bool;
cfg = config.${namespace}.desktop;
in
{
options.${namespace}.desktop = {
use = mkOption {
type = nullOr enum (attrNames (filterAttrs (n: type == "directory") (readDir ./.)));
default = null;
example = "plasma";
description = "Which desktop to enable";
};
autoLogin = mkOption {
type = bool;
default = false;
example = true;
description = "Enable plasma's auto login feature.";
};
};
config = mkMerge [
(mkIf cfg.desktop != null {
"${namespace}".desktop.${cfg.use}.enable = true;
services.displayManager = {
enable = true;
autoLogin = mkIf cfg.autoLogin {
enable = true;
};
};
})
];
}