niksos/modules/gui/cursor.nix
jacekpoz 59febb2149
move the config' arg to a custom module (big)
shoutout to raf for pointing out how retarded this was
this was needed very much
2024-02-29 00:29:56 +01:00

39 lines
1,011 B
Nix

{
config,
lib,
...
}: with lib; let
cfg = config.myOptions.themes.cursor;
username = config.myOptions.other.system.username;
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 {
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;
};
};
};
}