niksos/modules/gui/cursor.nix

42 lines
1 KiB
Nix

{
config,
lib,
...
}: let
cfg = config.myOptions.themes.cursor;
inherit (config.myOptions.other.system) username;
inherit (lib) mkEnableOption mkIf mkOption;
inherit (lib.types) int package str;
in {
options.myOptions.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;
};
};
};
}