initial hyprcursor work

This commit is contained in:
jacekpoz 2024-03-11 17:21:34 +01:00
parent ef97bd4225
commit 32d6fb98cb
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -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;
};
};
};