From 2b4c2d136575db941e111d7e6b260231b113f39c Mon Sep 17 00:00:00 2001 From: polykernel <81340136+polykernel@users.noreply.github.com> Date: Mon, 2 Jan 2023 23:36:24 -0500 Subject: [PATCH] home.pointerCursor: remove backend specific `enable` options This PR removes the `home.pointerCursor..enable` options for each backend in favour of using global options to toggle backend specific cursor configurations. This change was motivated by https://github.com/nix-community/home-manager/pull/3545 and improves integration of `home.pointerCursor` with other home-manager modules. --- modules/config/home-cursor.nix | 35 ++++++++-------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/modules/config/home-cursor.nix b/modules/config/home-cursor.nix index d8cbb53903ed..fc490a9702a9 100644 --- a/modules/config/home-cursor.nix +++ b/modules/config/home-cursor.nix @@ -28,10 +28,6 @@ let }; x11 = { - enable = mkEnableOption '' - x11 config generation for - ''; - defaultCursor = mkOption { type = types.str; default = "left_ptr"; @@ -39,12 +35,6 @@ let description = "The default cursor file to use within the package."; }; }; - - gtk = { - enable = mkEnableOption '' - gtk config generation for - ''; - }; }; }; @@ -77,17 +67,6 @@ in { "x11" "defaultCursor" ]) - - ({ ... }: { - warnings = optional (any (x: - getAttrFromPath - ([ "xsession" "pointerCursor" ] ++ [ x ] ++ [ "isDefined" ]) - options) [ "package" "name" "size" "defaultCursor" ]) '' - The option `xsession.pointerCursor` has been merged into `home.pointerCursor` and will be removed - in the future. Please change to set `home.pointerCursor` directly and enable `home.pointerCursor.x11.enable` - to generate x11 specific cursor configurations. You can refer to the documentation for more details. - ''; - }) ]; options = { @@ -100,10 +79,12 @@ in { Top-level options declared under this submodule are backend indepedent options. Options declared under namespaces such as x11 are backend specific options. By default, only backend independent cursor - configurations are generated. If you need configurations for specific - backends, you can toggle them via the enable option. For example, - - will enable x11 cursor configurations. + configurations are generated. + + X11 specific cursor configurations are enabled when the X session is enabled via + . + GTK specific cursor configurations are enabled when GTK configurations are enabled via + . ''; }; }; @@ -136,7 +117,7 @@ in { }; } - (mkIf cfg.x11.enable { + (mkIf config.xsession.enable { xsession.initExtra = '' ${pkgs.xorg.xsetroot}/bin/xsetroot -xcf ${cursorPath} ${ toString cfg.size @@ -149,7 +130,7 @@ in { }; }) - (mkIf cfg.gtk.enable { + (mkIf config.gtk.enable { gtk.cursorTheme = mkDefault { inherit (cfg) package name size; }; }) ]);