diff --git a/modules/gui/cursor.nix b/modules/gui/cursor.nix index e29f039..0116c05 100644 --- a/modules/gui/cursor.nix +++ b/modules/gui/cursor.nix @@ -1,6 +1,7 @@ { config, lib, + pkgs, ... }: with lib; let cfg = config.myOptions.themes.cursor; @@ -8,12 +9,12 @@ in { options.myOptions.themes.cursor = { enable = mkEnableOption "enable cursor theming"; - package = mkOption { - description = "cursor theme package"; - type = types.package; + src = mkOption { + description = "hyprcursor theme tar url"; + type = types.path; }; name = mkOption { - description = "cursor theme name"; + description = "hyprcursor theme name"; type = types.str; }; size = mkOption { @@ -24,15 +25,26 @@ in { config = mkIf cfg.enable { environment.sessionVariables = { - XCURSOR_THEME = "${cfg.name}"; - XCURSOR_SIZE = "${toString cfg.size}"; + HYPRCURSOR_THEME = cfg.name; + HYPRCURSOR_SIZE = toString cfg.size; }; home-manager.users.${username} = { - home.pointerCursor = { - inherit (cfg) package name size; - gtk.enable = true; - x11.enable = true; + home.file.".local/share/icons" = { + source = with pkgs; stdenvNoCC.mkDerivation (finalAttrs: { + pname = cfg.name; + version = "0.1.0"; + + inherit (cfg) src; + + buildPhase = '' + runHook preBuild + mkdir -p $out + tar -C $out -x -f $src + runHook postBuild + ''; + }); + recursive = true; }; }; };