2023-09-08 16:10:15 +02:00
|
|
|
{
|
|
|
|
config,
|
2023-10-13 21:04:24 +02:00
|
|
|
lib,
|
2023-09-08 16:10:15 +02:00
|
|
|
...
|
2024-05-05 12:38:40 +02:00
|
|
|
}: let
|
2024-07-15 23:18:25 +02:00
|
|
|
cfg = config.poz.themes.gtk;
|
|
|
|
inherit (config.poz.other.system) username;
|
2024-02-29 00:29:56 +01:00
|
|
|
hmCfg = config.home-manager.users.${username};
|
2024-05-05 12:38:40 +02:00
|
|
|
|
2024-07-25 11:45:44 +02:00
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
inherit (lib.options) mkEnableOption mkOption;
|
2024-05-05 12:38:40 +02:00
|
|
|
inherit (lib.types) package str submodule;
|
2023-10-13 21:04:24 +02:00
|
|
|
in {
|
2024-07-15 23:18:25 +02:00
|
|
|
options.poz.themes.gtk = {
|
2024-04-05 22:59:32 +02:00
|
|
|
enable = mkEnableOption "gtk theming";
|
2023-10-13 21:04:24 +02:00
|
|
|
name = mkOption {
|
|
|
|
description = "gtk theme name";
|
2024-05-05 12:38:40 +02:00
|
|
|
type = str;
|
2023-10-13 21:04:24 +02:00
|
|
|
};
|
|
|
|
variant = mkOption {
|
|
|
|
description = "gtk theme variant";
|
2024-05-05 12:38:40 +02:00
|
|
|
type = str;
|
2023-10-13 21:04:24 +02:00
|
|
|
};
|
|
|
|
accentColour = mkOption {
|
|
|
|
description = "accent colour for gtk theme";
|
2024-05-05 12:38:40 +02:00
|
|
|
type = str;
|
2023-10-13 21:04:24 +02:00
|
|
|
};
|
|
|
|
package = mkOption {
|
|
|
|
description = "gtk theme package";
|
2024-05-05 12:38:40 +02:00
|
|
|
type = package;
|
2023-09-08 16:10:15 +02:00
|
|
|
};
|
2023-10-13 21:04:24 +02:00
|
|
|
iconTheme = mkOption {
|
|
|
|
description = "gtk icon theme";
|
2024-05-05 12:38:40 +02:00
|
|
|
type = submodule {
|
2023-10-13 21:04:24 +02:00
|
|
|
options = {
|
|
|
|
name = mkOption {
|
|
|
|
description = "gtk icon theme name";
|
|
|
|
type = str;
|
|
|
|
};
|
|
|
|
package = mkOption {
|
|
|
|
description = "gtk icon theme package";
|
|
|
|
type = package;
|
|
|
|
};
|
|
|
|
};
|
2023-09-08 16:10:15 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-10-13 21:04:24 +02:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-02-29 00:29:56 +01:00
|
|
|
home-manager.users.${username} = {
|
2023-10-13 21:04:24 +02:00
|
|
|
gtk = {
|
|
|
|
enable = true;
|
|
|
|
theme = {
|
|
|
|
inherit (cfg) name;
|
|
|
|
package = cfg.package.override {
|
|
|
|
size = "standard";
|
|
|
|
accents = [ cfg.accentColour ];
|
|
|
|
inherit (cfg) variant;
|
|
|
|
tweaks = [ "normal" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
iconTheme = {
|
|
|
|
inherit (cfg.iconTheme) name;
|
|
|
|
package = cfg.iconTheme.package.override {
|
|
|
|
accent = cfg.accentColour;
|
|
|
|
flavor = cfg.variant;
|
|
|
|
};
|
|
|
|
};
|
2024-02-14 21:14:45 +01:00
|
|
|
gtk2 = {
|
|
|
|
configLocation = "${hmCfg.xdg.configHome}/gtk-2.0/gtkrc";
|
|
|
|
};
|
2023-10-13 21:04:24 +02:00
|
|
|
};
|
|
|
|
home.sessionVariables = {
|
|
|
|
GTK_THEME = cfg.name;
|
|
|
|
GTK_USE_PORTAL = "1";
|
|
|
|
};
|
2023-09-08 16:10:15 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|