blob: 1bd03feb03bd13f585ac09d0ce6e6b7eba31afc2 (
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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
{
pkgs,
config,
lib,
my-lib,
...
}: let
inherit (lib) mkOption mkEnableOption types;
inherit (my-lib.options {inherit lib config;}) mkProgramOption mkThemeOption;
in {
options = {
collinux.desktop = {
wallpaper = mkOption {
type = with types; oneOf [str path];
description = "File to use as the wallpaper on this machine";
};
wallpaper_cmd = mkOption {
type = types.str;
default = "${lib.getExe pkgs.wbg} -s ${config.collinux.desktop.wallpaper}";
internal = true;
};
greetd = {
enable = mkEnableOption "greetd greeter";
autologin = {
enable = mkEnableOption "autologin";
command = mkOption {
type = lib.types.str;
default = with config.collinux.desktop;
if (wm.sway.enable && !gnome.enable && !wm.niri.enable)
then "${pkgs.sway}/bin/sway"
else if (wm.niri.enable && !gnome.enable && !wm.sway.enable)
then "${pkgs.niri}/bin/niri-session"
else null;
};
};
cosmic-greeter.enable = mkEnableOption "cosmic-greeter";
};
gdm.enable = mkEnableOption "gdm display manager";
wm = {
sway.enable = mkEnableOption "sway";
niri.enable = mkEnableOption "niri";
components = {
dunst = mkProgramOption "dunst";
fuzzel = mkProgramOption "fuzzel";
};
};
gnome.enable = mkEnableOption "gnome";
gtk = {
enable = mkEnableOption "gtk theming";
theme = mkThemeOption "gtk";
cursor_data = mkOption {
internal = true;
type = lib.types.submodule {
options = {
package = mkOption {
internal = true;
type = lib.types.package;
};
name = mkOption {
internal = true;
type = lib.types.str;
};
};
};
default =
if config.collinux.desktop.gtk.theme == "catppuccin"
then {
name = "catppuccin-mocha-dark-cursors";
package = pkgs.catppuccin-cursors.mochaDark;
}
else if config.collinux.desktop.gtk.theme == "adwaita"
then {
name = "Vanilla-DMZ";
package = pkgs.vanilla-dmz;
}
else null;
};
theme_data = mkOption {
internal = true;
type = lib.types.submodule {
options = {
package = mkOption {
internal = true;
type = lib.types.package;
};
name = mkOption {
internal = true;
type = lib.types.str;
};
};
};
default =
if config.collinux.desktop.gtk.theme == "catppuccin"
then {
package = pkgs.catppuccin-gtk.override {
variant = "mocha";
accents = ["blue"];
size = "standard";
};
name = "catppuccin-mocha-blue-standard";
}
else if config.collinux.desktop.gtk.theme == "adwaita"
then {
package = pkgs.adw-gtk3;
name = "adw-gtk3";
}
else null;
};
};
programs = {
firefox = {
enable = mkEnableOption "firefox";
profileName = mkOption {
type = types.str;
default = config.collinux.user.name;
internal = true;
};
theme = mkThemeOption "firefox";
extensions.zotero.enable = mkOption {
description = "install Zotero Connector for Firefox";
default = config.collinux.desktop.programs.research.enable;
};
};
foot = mkProgramOption "foot";
blackbox.enable = mkEnableOption "blackbox";
ghostty.enable = mkEnableOption "ghostty";
alacritty.enable = mkEnableOption "alacritty";
research.enable = mkEnableOption "zathura, Xournal++, Zotero";
};
};
};
config = {
assertions = [
{
assertion = with config.collinux.desktop; !(gdm.enable && greetd.enable);
message = "Can't enable gdm and greetd at the same time";
}
{
assertion = with config.collinux.desktop.greetd; enable -> !(autologin.enable && cosmic-greeter.enable);
message = "Can't use autologin and cosmic-greeter at the same time";
}
];
};
}
|