blob: 4719b5d66e75c43a1b1b1bb0adbf7f9b4d403a3a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
{pkgs, lib, config,...}:
with lib;
let
wmMeta = config.addons.desktop.wmMeta;
# Gets all the vm's that are enabled and checks which protocols are used
enabledWMs = (filter (wm: wm.enable) (attrValues wmMeta));
protos = (unique (map (wm: wm.protocol) enabledWMs));
desktopEnabled = protos != [];
x11Enabled = elem "x11" protos;
waylandEnabled = elem "wayland" protos;
in {
imports = [
./common.nix
./x11.nix
./wayland.nix
./wms
./steam.nix
];
options.addons.desktop = with types; {
wmMeta = mkOption {
type = attrsOf (submodule {
options = {
enable = mkOption {
type = bool;
default = false;
};
protocol = mkOption {
type = str;
description = "Used display protocol (x11 or wayland)";
};
};
});
default = {};
description = "Window manager metadata used for determining which protocol to enable.";
};
# enable = lib.mkEnableOption "Whenever any desktop environment is enabled.";
# x11.enable = lib.mkEnableOption "Whenever x11 desktop environment is enabled.";
# wayland.enable = lib.mkEnableOption "Whenever wayland desktop environment is enabled.";
};
config.addons.desktop = {
enable = desktopEnabled;
x11.enable = x11Enabled;
wayland.enable = waylandEnabled;
};
}
|