niksos/modules/gui/cursor.nix

40 lines
968 B
Nix
Raw Normal View History

2023-10-13 21:04:24 +02:00
{
config,
config',
lib,
...
}: with lib; let
cfg = config.myOptions.themes.cursor;
in {
options.myOptions.themes.cursor = {
enable = mkEnableOption "enable cursor theming";
package = mkOption {
description = "cursor theme package";
type = types.package;
};
name = mkOption {
description = "cursor theme name";
type = types.str;
};
size = mkOption {
description = "cursor size";
type = types.int;
};
};
config = mkIf cfg.enable {
2024-02-14 15:53:32 +01:00
environment.sessionVariables = {
XCURSOR_THEME = "${cfg.name}";
XCURSOR_SIZE = "${cfg.size}";
};
2023-10-13 21:04:24 +02:00
home-manager.users.${config'.username} = {
home.pointerCursor = {
inherit (cfg) package name size;
gtk.enable = true;
x11.enable = true;
};
};
};
}