From 99a5b68920b6d8a66727506f0a526d0362af97f1 Mon Sep 17 00:00:00 2001 From: Shun Kakinoki Date: Wed, 4 Mar 2026 15:45:28 +0000 Subject: [PATCH] fix(xremap): suppress enable=false warning on non-desktop hosts --- home-manager/modules/xremap/default.nix | 57 +++++++++++++------------ 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/home-manager/modules/xremap/default.nix b/home-manager/modules/xremap/default.nix index 28106f2eb..a8aa848d5 100644 --- a/home-manager/modules/xremap/default.nix +++ b/home-manager/modules/xremap/default.nix @@ -90,33 +90,36 @@ let }; in { - config = lib.mkIf (isDesktop && isLinux) { - services.xremap = { - enable = true; - withWlroots = true; - watch = true; - # Only intercept keyd output — SUPER (CapsLock/RightAlt) goes straight to Hyprland - deviceNames = [ "keyd virtual keyboard" ]; - config = { - keymap = [ - { - name = "Framework Command (Ghostty)"; - application.only = [ "com.mitchellh.ghostty" ]; - remap = ghosttyRemap; - } - { - name = "Framework Command (Global)"; - application.not = [ "com.mitchellh.ghostty" ]; - remap = globalRemap; - } - ]; + config = lib.mkMerge [ + { services.xremap.enable = lib.mkDefault false; } + (lib.mkIf (isDesktop && isLinux) { + services.xremap = { + enable = true; + withWlroots = true; + watch = true; + # Only intercept keyd output — SUPER (CapsLock/RightAlt) goes straight to Hyprland + deviceNames = [ "keyd virtual keyboard" ]; + config = { + keymap = [ + { + name = "Framework Command (Ghostty)"; + application.only = [ "com.mitchellh.ghostty" ]; + remap = ghosttyRemap; + } + { + name = "Framework Command (Global)"; + application.not = [ "com.mitchellh.ghostty" ]; + remap = globalRemap; + } + ]; + }; }; - }; - # Upstream module already sets After/PartOf/Restart; only add extras. - systemd.user.services.xremap = { - Unit.StartLimitIntervalSec = 0; - Service.RestartSec = 3; - }; - }; + # Upstream module already sets After/PartOf/Restart; only add extras. + systemd.user.services.xremap = { + Unit.StartLimitIntervalSec = 0; + Service.RestartSec = 3; + }; + }) + ]; }