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
/
gtk.nix
86 lines (77 loc) · 2.16 KB
/
gtk.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
{
config,
pkgs,
lib,
...
}: let
inherit (builtins) pathExists;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) str package int;
cfg = config.modules.style.gtk;
in {
# Theming options for GTK programs. Will be passed verbatim to home-manager
# in some cases.
options.modules.style.gtk = {
enable = mkEnableOption "GTK theming options";
usePortal = mkEnableOption "native desktop portal use for filepickers [xdg-desktop-portal-gtk]";
theme = {
name = mkOption {
type = str;
default = "catppuccin-mocha-blue-standard+normal";
description = "The name for the GTK theme package";
};
package = mkOption {
type = package;
description = "The theme package to be used for GTK programs";
default = pkgs.catppuccin-gtk.override {
variant = "mocha";
size = "standard";
accents = ["blue"];
tweaks = ["normal"];
};
};
};
iconTheme = {
name = mkOption {
type = str;
description = "The name for the icon theme that will be used for GTK programs";
default = "Papirus-Dark";
};
package = mkOption {
type = package;
description = "The GTK icon theme to be used";
default = pkgs.catppuccin-papirus-folders.override {
accent = "blue";
flavor = "mocha";
};
};
};
font = {
name = mkOption {
type = str;
description = "The name of the font that will be used for GTK applications";
default = "Lexend";
};
size = mkOption {
type = int;
description = "The size of the font";
default = 14;
};
};
};
config = {
assertions = [
(let
themePath = cfg.theme.package + /share/themes + "/${cfg.theme.name}";
in {
assertion = cfg.enable -> pathExists themePath;
message = ''
${toString themePath} set by the GTK module does not exist!
To suppress this message, make sure that
`config.modules.style.gtk.theme.package` contains
the path `${cfg.theme.name}`
'';
})
];
};
}