This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
desktop.nix
125 lines (109 loc) · 2.94 KB
/
desktop.nix
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{
inputs',
config,
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.types) bool enum package;
cfg = config.modules.usrEnv;
sys = config.modules.system;
in {
options.modules.usrEnv = {
desktop = mkOption {
type = enum ["none" "Hyprland" "sway" "awesomewm" "i3"];
default = "none";
description = ''
The desktop environment to be used.
'';
};
desktops = {
hyprland = {
enable = mkOption {
type = bool;
default = cfg.desktop == "Hyprland";
description = ''
Whether to enable Hyprland wayland compositor.
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "Hyprland".
'';
};
package = mkOption {
type = package;
default = inputs'.hyprland.packages.hyprland;
description = ''
The Hyprland package to be used.
'';
};
};
sway = {
enable = mkOption {
type = bool;
default = cfg.desktop == "sway";
description = ''
Whether to enable Sway wayland compositor.
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "sway".
'';
};
package = mkOption {
type = package;
default = pkgs.sway;
description = ''
The Sway package to be used.
'';
};
};
awesomwm.enable = mkOption {
type = bool;
default = cfg.desktop == "awesomewm";
description = ''
Whether to enable Awesome window manager
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "awesomewm".
'';
};
i3 = {
enable = mkOption {
type = bool;
default = cfg.desktop == "i3";
description = ''
Whether to enable i3 window manager
Will be enabled automatically when `modules.usrEnv.desktop`
is set to "i3".
'';
};
package = mkOption {
type = package;
default = pkgs.i3;
description = ''
The i3 package to be used.
'';
};
};
};
useHomeManager = mkOption {
type = bool;
default = true;
description = ''
Whether to enable the usage of home-manager for user home
management. My home-manager module will map the list of users to
their home directories inside the `homes/` directory in the
repository root.
::: {.warning}
Username via `modules.system.mainUser` must be set if
this option is enabled.
:::
'';
};
};
config = {
assertions = [
{
assertion = cfg.useHomeManager -> sys.mainUser != null;
message = "modules.system.mainUser must be set while modules.usrEnv.useHomeManager is enabled";
}
];
};
}