From 8a5001cc00a50b473e4261deb7c0fb3c036498c4 Mon Sep 17 00:00:00 2001 From: Isaac Corbrey Date: Fri, 2 Oct 2026 13:33:12 -0400 Subject: [PATCH] macos: Install and configure AnyDrag AnyDrag only builds through Xcode, so this repackages the signed and notarized release DMG rather than building from source, keeping the Developer ID signature that Accessibility grants are keyed to. Sparkle update checks are disabled since it cannot replace a bundle living in the Nix store, and analytics are opted out. --- modules/home/macos/default.nix | 20 ++++++++++++++++++++ overlays.nix | 28 +++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/modules/home/macos/default.nix b/modules/home/macos/default.nix index 997da5e..b5320de 100644 --- a/modules/home/macos/default.nix +++ b/modules/home/macos/default.nix @@ -92,6 +92,26 @@ in { ReverseTrackpad = false; StartAtLogin = false; }; + + home.packages = [pkgs.anydrag]; + + targets.darwin.defaults."me.xueshi.anydrag" = { + SUEnableAutomaticChecks = false; + AnyDragAnalyticsEnabled = false; + AnyDragModifierFlags = 1; + }; + + launchd.agents.anydrag = { + enable = true; + config = { + ProgramArguments = ["${pkgs.anydrag}/Applications/AnyDrag.app/Contents/MacOS/AnyDrag"]; + RunAtLoad = true; + ProcessType = "Interactive"; + LimitLoadToSessionType = "Aqua"; + StandardOutPath = "/tmp/anydrag.out.log"; + StandardErrorPath = "/tmp/anydrag.err.log"; + }; + }; } (lib.mkIf splitScrolling { diff --git a/overlays.nix b/overlays.nix index 63cc5b8..8d839d8 100644 --- a/overlays.nix +++ b/overlays.nix @@ -13,6 +13,31 @@ } else {}; + # TK: Xcode-only build; repackage signed release DMG + anydragPackage = final: { + anydrag = final.stdenvNoCC.mkDerivation rec { + pname = "anydrag"; + version = "26.09.115"; + src = final.fetchurl { + url = "https://github.com/XueshiQiao/AnyDrag/releases/download/v${version}/AnyDrag.dmg"; + hash = "sha256-kDcaeJVhADdf+LsjrxuHPRDL+O4DH7bgnsJdpNC9g6Q="; + }; + nativeBuildInputs = [final._7zz]; + sourceRoot = "AnyDrag"; + installPhase = '' + mkdir -p $out/Applications + cp -R AnyDrag.app $out/Applications/ + ''; + meta = { + description = "Modifier+drag to move any window on macOS"; + homepage = "https://github.com/XueshiQiao/AnyDrag"; + license = final.lib.licenses.gpl3Only; + platforms = final.lib.platforms.darwin; + sourceProvenance = [final.lib.sourceTypes.binaryNativeCode]; + }; + }; + }; + badjujuPackage = final: if inputs ? badjuju then { @@ -108,7 +133,8 @@ in [ linuxWallpaperenginePR557 (final: prev: - optionalInputPackage "auto-cpufreq" inputs.auto-cpufreq "default" + anydragPackage final + // optionalInputPackage "auto-cpufreq" inputs.auto-cpufreq "default" // badjujuPackage final // helixPackage final // dsearchPackage final -- 2.54.0