Closed evertedsphere closed 3 years ago
i think something like this might be required
{
boot.kernelModules = [ "uinput" ];
services.udev.extraRules = ''
KERNEL=="uinput", MODE="0660", GROUP="input", OPTIONS+="static_node=uinput"
'';
}
@evertedsphere The first step here would be packaging KMonad in the Haskell package set. That way you could install it like nix-env -iA nixos.haskellPackages.kmonad
.
The easiest way to do this would be to get the maintainer to upload it Hackage. Nixpkgs (and other Linux distributions) have an automatic way of building and distributing packages that are on Hackage, so if the maintainer just uploads KMonad to Hackage, it will be easier for distros to support it. (Even better would be if the author is willing to get it in Stackage.) In fact, you would likely not have to do anything at all for this, because the process is entirely automatic here in nixpkgs.
Once KMonad is available in the Hackage package set, you will need to actually create a NixOS module for it. Maybe provide an option like services.kmonad.enable
, and when that is enabled, it sets the kernel modules and udev extra rules that you've discovered.
@cdepillabout that's helpful! i'll try my hand at it tomorrow if i can
Hey there,
I'm the core developer of KMonad. Just want to say it is very cool to see you guys adding it to nixpkgs. I also wanted to mention that I do actually have statically compiled binaries on the releases of the kmonad github page. Used static-haskell-nix
. Here's a link to the most recent one: https://github.com/david-janssen/kmonad/releases/download/0.4.0/kmonad-0.4.0-linux
Would that save people loads of compilation time? Or are these builds cached somewhere automatically? Not too nix-savvy I'm afraid.
EDIT: Oh, and I will be putting the code on Hackage as requested, after I've fixed up the haddocks.
@david-janssen Most Haskell packages here in nixpkgs are automatically pulled from Hackage and built with dynamic-linking, so having static packages doesn't really help us.
However, there are many non-Nix users (especially Non-Haskellers) that usually like having statically linked binaries available.
@cdepillabout Thanks for the info.
I will take some time to clean up the haddocks and then put everything on hackage. This might take a while though. Cheers!
We are now on hackage: https://hackage.haskell.org/package/kmonad
I marked this as stale due to inactivity. → More info
Since this is on Hackage, kmonad should now be available in nixpkgs.
Hi! kmonad is currently marked as broken on nixkpgs...
@aopom Please feel free to send a PR fixing it, or open an issue if you're not able to figure it out.
Is it's broken in nixpkgs, try the upstream module. I've been daily driving KMonad's upstream nixos module for some time now and it's been working widthout trouble.
Can this issue be reopened? Kmonad is still broken in nixpkgs. I would be interested in becoming a maintainer if necessary but it seems like hackage packages are made available to nixpkgs automatically. I am also not familiar with haskell projects.
@jfvillablanca Could you open an issue about fixing it? This issue was for the original request for providing it from Nixpkgs, but it is already in Nixpkgs. It is just broken.
Sure! Should I place it under Bug Report?
Build failure.
Project description uinput-based keyboard remapping software
Metadata
Edit: I would be happy to serve as maintainer for this, I just don't know much about setting up all the udev rules and such which is why I'd like some help here.