about summary refs log tree commit diff
path: root/pkgs/tools/system/kanata/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/kanata/default.nix')
-rw-r--r--pkgs/tools/system/kanata/default.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/tools/system/kanata/default.nix b/pkgs/tools/system/kanata/default.nix
index 706382d3dd04..88d4b0552b79 100644
--- a/pkgs/tools/system/kanata/default.nix
+++ b/pkgs/tools/system/kanata/default.nix
@@ -1,4 +1,6 @@
-{ lib
+{ stdenv
+, lib
+, darwin
 , rustPlatform
 , fetchFromGitHub
 , withCmd ? false
@@ -17,8 +19,15 @@ rustPlatform.buildRustPackage rec {
 
   cargoHash = "sha256-IzgVF6SHJjOB48VehQ5taD5iWQXFKLcVBWTEl3ArkGQ=";
 
+  buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.IOKit ];
+
   buildFeatures = lib.optional withCmd "cmd";
 
+  # Workaround for https://github.com/nixos/nixpkgs/issues/166205
+  env = lib.optionalAttrs stdenv.cc.isClang {
+    NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
+  };
+
   postInstall = ''
     install -Dm 444 assets/kanata-icon.svg $out/share/icons/hicolor/scalable/apps/kanata.svg
   '';
@@ -28,7 +37,7 @@ rustPlatform.buildRustPackage rec {
     homepage = "https://github.com/jtroo/kanata";
     license = licenses.lgpl3Only;
     maintainers = with maintainers; [ linj ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     mainProgram = "kanata";
   };
 }