From d49346473a815901ad6afb9ad5b9070dc50540d1 Mon Sep 17 00:00:00 2001 From: kinnrai Date: Wed, 3 Jun 2026 20:58:44 +0800 Subject: [PATCH 1/3] maintainers: add kinnrai --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 23cf0097e5d6..600f95a82cb4 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -14319,6 +14319,12 @@ githubId = 691290; name = "Keshav Kini"; }; + kinnrai = { + email = "me@kinnrai.com"; + github = "kinnrai"; + githubId = 72676584; + name = "kinnrai"; + }; kintrix = { email = "kintrix007@proton.me"; github = "kintrix007"; From 81a56518803e6b148ed80039e0358265a752194a Mon Sep 17 00:00:00 2001 From: kinnrai Date: Fri, 29 May 2026 00:03:38 +0800 Subject: [PATCH 2/3] swipeaerospace: init at 0.3.0 --- pkgs/by-name/sw/swipeaerospace/package.nix | 174 ++++++++++++++++++ .../sw/swipeaerospace/settings-window.patch | 36 ++++ 2 files changed, 210 insertions(+) create mode 100644 pkgs/by-name/sw/swipeaerospace/package.nix create mode 100644 pkgs/by-name/sw/swipeaerospace/settings-window.patch diff --git a/pkgs/by-name/sw/swipeaerospace/package.nix b/pkgs/by-name/sw/swipeaerospace/package.nix new file mode 100644 index 000000000000..8638539a9cc5 --- /dev/null +++ b/pkgs/by-name/sw/swipeaerospace/package.nix @@ -0,0 +1,174 @@ +{ + actool, + darwin, + fetchFromGitHub, + lib, + nix-update-script, + swiftPackages, +}: + +let + inherit (swiftPackages) stdenv swift; + + blueSocket = stdenv.mkDerivation (finalAttrs: { + pname = "blue-socket"; + version = "2.0.4"; + + strictDeps = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "Kitura"; + repo = "BlueSocket"; + tag = finalAttrs.version; + hash = "sha256-Bru14uTGvmAeRLjbFYhWKfRjQcj5cZzp9jzyg5o7EHs="; + }; + + nativeBuildInputs = [ + swift + darwin.autoSignDarwinBinariesHook + ]; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + + buildDir="$PWD/build" + mkdir -p "$buildDir" + + swiftc \ + -O \ + -swift-version 5 \ + -emit-library \ + -emit-module \ + -module-name Socket \ + -emit-module-path "$buildDir/Socket.swiftmodule" \ + -Xlinker -install_name -Xlinker "$out/lib/swift/libSocket.dylib" \ + Sources/Socket/*.swift \ + -o "$buildDir/libSocket.dylib" + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p "$out/lib/swift" + cp build/libSocket.dylib "$out/lib/swift/" + cp build/Socket.* "$out/lib/swift/" + + runHook postInstall + ''; + }); + + infoPlist = + version: + lib.generators.toPlist { escape = true; } { + CFBundleDevelopmentRegion = "en"; + CFBundleDisplayName = "SwipeAeroSpace"; + CFBundleExecutable = "SwipeAeroSpace"; + CFBundleIconFile = "AppIcon"; + CFBundleIconName = "AppIcon"; + CFBundleIdentifier = "club.mediosz.SwipeAeroSpace"; + CFBundleInfoDictionaryVersion = "6.0"; + CFBundleName = "SwipeAeroSpace"; + CFBundlePackageType = "APPL"; + CFBundleShortVersionString = version; + CFBundleSupportedPlatforms = [ "MacOSX" ]; + CFBundleVersion = "18"; + LSApplicationCategoryType = "public.app-category.developer-tools"; + LSMinimumSystemVersion = "13.5"; + LSUIElement = true; + NSHumanReadableCopyright = "©Tricster"; + }; +in +stdenv.mkDerivation (finalAttrs: { + pname = "swipeaerospace"; + version = "0.3.0"; + + strictDeps = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "MediosZ"; + repo = "SwipeAeroSpace"; + tag = finalAttrs.version; + hash = "sha256-wm2fx0co7oETr8CDV4ie0rjZylUrWB/j4r9D/wwnSso="; + }; + + # Keep SettingsView unchanged, but open it through a regular WindowGroup. + # @Environment(\.openSettings) does not compile with nixpkgs' SwiftUI SDK. + patches = [ ./settings-window.patch ]; + + nativeBuildInputs = [ + swift + actool + darwin.autoSignDarwinBinariesHook + ]; + + buildInputs = [ blueSocket ]; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + + buildDir="$PWD/build" + mkdir -p "$buildDir" + + swiftFiles=() + while IFS= read -r -d "" f; do + swiftFiles+=("$f") + done < <(find SwipeAeroSpace -name '*.swift' -print0) + + swiftc \ + -O \ + -swift-version 5 \ + -parse-as-library \ + -module-name SwipeAeroSpace \ + -Xlinker -platform_version -Xlinker macos -Xlinker 13.5 -Xlinker 26.0 \ + -framework AppKit \ + -framework Cocoa \ + -framework SwiftUI \ + -framework ServiceManagement \ + -lSocket \ + "''${swiftFiles[@]}" \ + -o "$buildDir/SwipeAeroSpace" + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + app="$out/Applications/SwipeAeroSpace.app" + mkdir -p "$app/Contents/"{MacOS,Resources} + + cp build/SwipeAeroSpace "$app/Contents/MacOS/SwipeAeroSpace" + printf '%s' ${lib.escapeShellArg (infoPlist finalAttrs.version)} > "$app/Contents/Info.plist" + printf 'APPL????' > "$app/Contents/PkgInfo" + + actool --compile "$app/Contents/Resources" \ + --platform macosx \ + --minimum-deployment-target 13.5 \ + --app-icon AppIcon \ + --output-partial-info-plist /dev/null \ + SwipeAeroSpace/Assets.xcassets + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Switch AeroSpace workspaces by swiping"; + homepage = "https://github.com/MediosZ/SwipeAeroSpace"; + license = with lib.licenses; [ + asl20 + mit + ]; + maintainers = with lib.maintainers; [ kinnrai ]; + platforms = lib.platforms.darwin; + }; +}) diff --git a/pkgs/by-name/sw/swipeaerospace/settings-window.patch b/pkgs/by-name/sw/swipeaerospace/settings-window.patch new file mode 100644 index 000000000000..a70bb1b31375 --- /dev/null +++ b/pkgs/by-name/sw/swipeaerospace/settings-window.patch @@ -0,0 +1,36 @@ +--- a/SwipeAeroSpace/SwipeAeroSpaceApp.swift ++++ b/SwipeAeroSpace/SwipeAeroSpaceApp.swift +@@ -10,10 +10,0 @@ import SwiftUI +-@available(macOS 14.0, *) +-struct SettingsButton: View { +- @Environment(\.openSettings) private var openSettings +- +- var body: some View { +- Button("Settings") { +- openSettings() +- } +- } +-} +@@ -64,16 +54,4 @@ struct SwipeAeroSpaceApp: App { +- if #available(macOS 14.0, *) { +- SettingsButton() +- } else { +- Button( +- action: { +- NSApp.sendAction( +- Selector(("showSettingsWindow:")), +- to: nil, +- from: nil +- ) +- }, +- label: { +- Text("Settings") +- } +- ) ++ Button("Settings") { ++ NSApp.activate(ignoringOtherApps: true) ++ openWindow(id: "settings") + } +@@ -92 +70 @@ struct SwipeAeroSpaceApp: App { +- Settings { ++ WindowGroup(id: "settings") { From 39405122ac15e7372ed6685bda3bc8fd9552dd3a Mon Sep 17 00:00:00 2001 From: Oleksii Filonenko Date: Mon, 29 Jun 2026 14:05:19 +0100 Subject: [PATCH 3/3] swipeaerospace: 0.3.0 -> 0.3.1 --- pkgs/by-name/sw/swipeaerospace/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/sw/swipeaerospace/package.nix b/pkgs/by-name/sw/swipeaerospace/package.nix index 8638539a9cc5..9566311cf313 100644 --- a/pkgs/by-name/sw/swipeaerospace/package.nix +++ b/pkgs/by-name/sw/swipeaerospace/package.nix @@ -85,7 +85,7 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "swipeaerospace"; - version = "0.3.0"; + version = "0.3.1"; strictDeps = true; __structuredAttrs = true; @@ -93,8 +93,8 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "MediosZ"; repo = "SwipeAeroSpace"; - tag = finalAttrs.version; - hash = "sha256-wm2fx0co7oETr8CDV4ie0rjZylUrWB/j4r9D/wwnSso="; + tag = "v${finalAttrs.version}"; + hash = "sha256-468QGWjbRtA9Fml6jjeJZBTCUEp227cQPckqwyLK0dM="; }; # Keep SettingsView unchanged, but open it through a regular WindowGroup.