nix-darwin icon indicating copy to clipboard operation
nix-darwin copied to clipboard

fix karabiner-elements on macos

Open auscyber opened this issue 3 months ago • 21 comments

its a bit of a crazy nightmare and depends on my other pr #1594 but it does work finally responding finally to #1041

auscyber avatar Sep 20 '25 08:09 auscyber

if needed, i could split up the driverkit stuff into a separate option so that it can be used with kanata and kmonad

auscyber avatar Sep 20 '25 08:09 auscyber

okay, these checks will fail, because they depend on a new two prs i have for nixpkgs https://github.com/NixOS/nixpkgs/pull/444872 and https://github.com/NixOS/nixpkgs/pull/444622

but the layout is much more modular and allows for actual configuration for kanata and other karabiner-driverkit derived packages

auscyber avatar Sep 21 '25 08:09 auscyber

Thanks for that change!

I'm on macOS Tahoe, and here's a summary from the stuff I run into (with the flake configured as mentioned in this comment: https://github.com/nix-darwin/nix-darwin/pull/1595#discussion_r2413256743):

  • Initially I get spammed with "The program is damaged and can't be opened"

    • image
    • It partially works after allowing this at the "Privacy & Security screen":

      • image
    • I don't know how other packages do this, but it would be possible to remove the quarantine attribute: https://www.perplexity.ai/search/i-have-an-app-i-want-to-instal-5_FvnddFTo2rX9MhymzUkg#1

  • Clicking "Settings" on the Karabiner tray icon results in "The file can't be found"

    • image
  • Launch EventViewer results in "The file can't be found"

    • image
  • Even though the permissions are enabled, Karabiner keeps asking to enable them:

    • image - image
    • image

daneov avatar Oct 08 '25 11:10 daneov

are you using my fork of nixpkgs?

auscyber avatar Oct 08 '25 12:10 auscyber

https://github.com/NixOS/nixpkgs/pull/445407#issue-3443644951 is needed

auscyber avatar Oct 08 '25 12:10 auscyber

nice work

phucisstupid avatar Oct 11 '25 14:10 phucisstupid

okay it's been merged use master

auscyber avatar Oct 13 '25 11:10 auscyber

Cool! I'd be happy to start using this. I would like to use it to make Aerospace easier to use on my Mac :)

I'm not a maintainer or anything, but there is one check failing in the pipeline. I guess that needs to be fixed before this is in "ready" state? No pressure, just curiosity and trying to be helpful.

daneov avatar Oct 14 '25 06:10 daneov

Cool! I'd be happy to start using this. I would like to use it to make Aerospace easier to use on my Mac :)

I'm not a maintainer or anything, but there is one check failing in the pipeline. I guess that needs to be fixed before this is in "ready" state? No pressure, just curiosity and trying to be helpful.

this should work as long as you use master, and unstable in a lil bit once it gets merged into that, i'm also backporting karabiner-dk to 25.05

auscyber avatar Oct 14 '25 10:10 auscyber

@Enzime: is this PR an appropriate solution for #1041?

daneov avatar Oct 17 '25 20:10 daneov

As an enthusiast it'd be nice to get Karabiner working. Would this PR be an appropriate solution to that, @Enzime?

Not meaning to be pushy, but I'd also prefer to just depend on nix-darwin and not on a fork to get this functionality :) Thanks!

daneov avatar Oct 30 '25 08:10 daneov

everything has been merged into main and 25.05 so it should be all good

auscyber avatar Oct 30 '25 12:10 auscyber

Hello, thanks for your work! I'm trying to use your work but I have the same issues as @daneov mentioned. Did I miss something? I use nixpkgs/master and your two PR on nix-darwin.

When I apply my flake, it seems to be stuck at "attempt to activate karabiner system extension and start daemons" and I see popups about the application being not found and damaged.

I just have set this in my config: services.karabiner-elements.enable = true;

AdoPi avatar Nov 02 '25 11:11 AdoPi

Hello, thanks for your work! I'm trying to use your work but I have the same issues as @daneov mentioned. Did I miss something? I use nixpkgs/master and your two PR on nix-darwin.

When I apply my flake, it seems to be stuck at "attempt to activate karabiner system extension and start daemons" and I see popups about the application being not found and damaged.

I just have set this in my config: services.karabiner-elements.enable = true;

Same for me. Machine restart helped unstuck "attempt to activate [...]", but I am constantly getting popups about app being damaged and the karabiner doesn't seem to load config and run properly.

kerdamon avatar Nov 02 '25 23:11 kerdamon

Hello, thanks for your work! I'm trying to use your work but I have the same issues as @daneov mentioned. Did I miss something? I use nixpkgs/master and your two PR on nix-darwin. When I apply my flake, it seems to be stuck at "attempt to activate karabiner system extension and start daemons" and I see popups about the application being not found and damaged. I just have set this in my config: services.karabiner-elements.enable = true;

Same for me. Machine restart helped unstuck "attempt to activate [...]", but I am constantly getting popups about app being damaged and the karabiner doesn't seem to load config and run properly.

Assuming this can be fixed automatically, it'd ideally be part of this PR. I think this relates to the app not being signed. @kerdamon / @AdoPi : could you check whether the Security portion of Settings has an "app blocked" thingie, which you should be able to "Run anyway".

@auscyber: I mean that I'd prefer not to depend on a fork, so getting this into master seems preferable :)

daneov avatar Nov 05 '25 16:11 daneov

Yes it was authorized to run in my case, at least from what I remember.

AdoPi avatar Nov 07 '25 17:11 AdoPi

i've fixed and changed this to use the new pathsToLink and this is a lot less sus when it comes to copying folders into /Library

auscyber avatar Dec 06 '25 04:12 auscyber

@Enzime thoughts?

auscyber avatar Dec 06 '25 04:12 auscyber

dont have time to dive in at the moment but you do seem to have some spurious formatting changes; it would be nice if you could amend your commits to remove those

Samasaur1 avatar Dec 06 '25 04:12 Samasaur1

dont have time to dive in at the moment but you do seem to have some spurious formatting changes; it would be nice if you could amend your commits to remove those

why would they have that out of curiosity ? like why would formatting it do that?

auscyber avatar Dec 06 '25 12:12 auscyber

I'm trying to use this now and experiencing issues like

setting up /Applications/Nix Apps...
rsync: [sender] change_dir "/nix/store/3k5w2n96cycvi5flad2ri4va4fjdn74k-system-applications//Library/Application" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.4.1]

Is it possible that the fix for allowing spaces somehow got broken again? I'm using follows with latest nixos-unstable.

NickHu avatar Dec 10 '25 16:12 NickHu