niksos/modules/gui/cursor.nix
2024-08-06 17:46:57 +02:00

43 lines
1.1 KiB
Nix

{
config,
lib,
...
}: let
cfg = config.poz.themes.cursor;
inherit (config.poz.other.system) username;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) int package str;
in {
options.poz.themes.cursor = {
enable = mkEnableOption "cursor theming";
package = mkOption {
description = "cursor theme package";
type = package;
};
name = mkOption {
description = "cursor theme name";
type = str;
};
size = mkOption {
description = "cursor size";
type = int;
};
};
config = mkIf cfg.enable {
environment.sessionVariables = {
XCURSOR_THEME = "${cfg.name}";
XCURSOR_SIZE = "${toString cfg.size}";
};
home-manager.users.${username} = {
home.pointerCursor = {
inherit (cfg) package name size;
gtk.enable = true;
x11.enable = true;
};
};
};
}