nixfiles/system/sessions/default.nix
NullBite 3cf6b93eb5
system: add mutually exclusive session option
This option makes desktop-specific specialisations easier to configure
2024-07-22 02:25:41 -04:00

27 lines
627 B
Nix

{ config, lib, options, ... }:
let
inherit (lib) types;
cfg = config.nixfiles.session;
in
{
imports = [
./hyprland.nix
./plasma.nix
];
options.nixfiles.session = lib.mkOption {
description = ''
Desktop session to enable. This option serves as a convenient way to
enable sessions in a mutually exclusive manner, e.g., for use with
specialisations.
'';
type = with types; nullOr (enum (builtins.attrNames options.nixfiles.sessions));
default = null;
example = "hyprland";
};
config = lib.mkIf (!(builtins.isNull cfg)) {
nixfiles.sessions.${cfg}.enable = true;
};
}