about summary refs log tree commit diff
path: root/pkgs/by-name/ma/maa-cli/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/ma/maa-cli/package.nix')
-rw-r--r--pkgs/by-name/ma/maa-cli/package.nix54
1 files changed, 34 insertions, 20 deletions
diff --git a/pkgs/by-name/ma/maa-cli/package.nix b/pkgs/by-name/ma/maa-cli/package.nix
index 47949052b883f..254e10da2303b 100644
--- a/pkgs/by-name/ma/maa-cli/package.nix
+++ b/pkgs/by-name/ma/maa-cli/package.nix
@@ -1,14 +1,16 @@
-{ lib
-, stdenv
-, rustPlatform
-, fetchFromGitHub
-, installShellFiles
-, makeWrapper
-, pkg-config
-, openssl
-, maa-assistant-arknights
-, android-tools
-, git
+{
+  lib,
+  stdenv,
+  rustPlatform,
+  fetchFromGitHub,
+  installShellFiles,
+  makeWrapper,
+  pkg-config,
+  openssl,
+  darwin,
+  maa-assistant-arknights,
+  android-tools,
+  git,
 }:
 
 rustPlatform.buildRustPackage rec {
@@ -28,13 +30,22 @@ rustPlatform.buildRustPackage rec {
     pkg-config
   ];
 
-  buildInputs = [
-    openssl
-  ];
+  buildInputs =
+    [ openssl ]
+    ++ lib.optionals stdenv.isDarwin (
+      with darwin.apple_sdk.frameworks;
+      [
+        Security
+        SystemConfiguration
+      ]
+    );
 
   # https://github.com/MaaAssistantArknights/maa-cli/pull/126
   buildNoDefaultFeatures = true;
-  buildFeatures = [ "git2" "core_installer" ];
+  buildFeatures = [
+    "git2"
+    "core_installer"
+  ];
 
   cargoHash = "sha256-iy9myT3bVW1TXCZx3ddiiDoDXx5BWqeQnSsJ97bc4IA=";
 
@@ -47,9 +58,12 @@ rustPlatform.buildRustPackage rec {
     mv $out/bin/maa $out/share/maa-assistant-arknights/
 
     makeWrapper $out/share/maa-assistant-arknights/maa $out/bin/maa \
-      --prefix PATH : "${lib.makeBinPath [
-        android-tools git
-      ]}"
+      --prefix PATH : "${
+        lib.makeBinPath [
+          android-tools
+          git
+        ]
+      }"
 
     installShellCompletion --cmd maa \
       --bash <($out/bin/maa complete bash) \
@@ -62,10 +76,10 @@ rustPlatform.buildRustPackage rec {
   '';
 
   meta = with lib; {
-    description = "A simple CLI for MAA by Rust";
+    description = "Simple CLI for MAA by Rust";
     homepage = "https://github.com/MaaAssistantArknights/maa-cli";
     license = licenses.agpl3Only;
-    platforms = platforms.linux;
+    platforms = platforms.linux ++ platforms.darwin;
     maintainers = with maintainers; [ Cryolitia ];
     mainProgram = "maa";
   };