sneeuwvlok/modules/nixos/desktop/default.nix
2025-07-24 11:33:23 +02:00

39 lines
821 B
Nix

{ lib, config, namespace, inputs, ... }:
let
inherit (lib) mkIf mkOption mkEnableOption mkMerge;
inherit (lib.types) nullOr enum;
cfg = config.${namespace}.desktop;
in
{
imports = [
inputs.grub2-themes.nixosModules.default
];
options.${namespace}.desktop = {
use = mkOption {
type = nullOr (enum [ "plasma" "gamescope" "gnome" ]);
default = null;
example = "plasma";
description = "Which desktop to enable";
};
autoLogin = mkEnableOption "Enable plasma's auto login feature.";
};
config = mkMerge [
({
services.displayManager = {
enable = true;
autoLogin = mkIf cfg.autoLogin {
enable = true;
};
};
})
# (mkIf (cfg.use != null) {
# ${namespace}.desktop.${cfg.use}.enable = true;
# })
];
}