mirror of
https://github.com/joleuger/vuinputd.git
synced 2026-11-05 01:17:20 +00:00
[GH-ISSUE #14] First-class NixOS support for vuinputd #12
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
joleuger/vuinputd#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joleuger on GitHub (May 6, 2026).
Original GitHub issue: https://github.com/joleuger/vuinputd/issues/14
First-class NixOS support for
vuinputdMotivation
vuinputdis evolving into a flexible userspace input virtualization daemon, and NixOS is a particularly strong target platform due to:Currently, NixOS support is work-in-progress and requires manual setup. The goal is to make
vuinputda first-class citizen on NixOS with a clean, idiomatic module.Reference draft documentation:
https://github.com/joleuger/vuinputd/blob/main/docs/USAGE-NIXOS.md
Goals
vuinputdto nixpkgs (if not already present or incomplete)Existing Work
Some community configurations already exist:
These can serve as inspiration but are not yet standardized.
Call for Feedback
Looking for input on:
PRs, ideas, and experiments are very welcome 🙂
@joleuger commented on GitHub (May 6, 2026):
Hi @griffi-gh , @ShaneTRS , @Markus328 ,
from past issues I know that you’re using NixOS and already have working setups for
vuinputd.I’ve started putting together a NixOS usage guide and referenced your repositories here:
https://github.com/joleuger/vuinputd/blob/main/docs/USAGE-NIXOS.md
I hope that’s okay with you—please let me know if you’d prefer not to be listed.
More generally, I’d really be interested in your experience:
Even brief feedback or pointers are very helpful.
Thanks!
@griffi-gh commented on GitHub (May 6, 2026):
I'd say isolation was the most awkward part, i couldn't get it running under anything but root + no systemd isolation
would've been nice to figure out a way to run it with more isolation/with less potential blast radius
@Markus328 commented on GitHub (May 7, 2026):
The most awkward for me was some strange behavior with permission on /dev/vuinput. I've created two systemd services for vuinput to work correctly here
@Markus328 commented on GitHub (May 7, 2026):
Sometimes the /dev/vuinput was not being truly functional inside the container due to permission issues, so using this approach helped me. About that ExecStartPre it probably is not needed anymore because its just a workaround to the virtual devices ownership inside the container.
I think creating a simple NixOS module for this is enough, just some options to automatically setup the placement on host if the user wants and maybe fixing this chmod as well. Another
extraFlagsto add custom flags as the major-minorAn example should be:
@Markus328 commented on GitHub (May 7, 2026):
Also, my outdated package of vuinputd. Think just changing the hash and removing that patch from allow_list (guess its already fixed?) would easily pack the latest version
@joleuger commented on GitHub (May 7, 2026):
Cool, thanks for your input.
As first measure, I'll patch that fuse3 problem. I think it is a blocker for every nixos user at first. You were only patient enough to fix it.
The only reason I currently need root permissions on the host is that it is pretty easy to get root inside the affected container, too. That is needed to send a netlink message to make libinput realize that a mouse or keyboard was plugged in (this works via libudev). Other ideas to reach the same goal is to
I think I will also make it default for the nixos configuration to make one vuinputd instance per container. The memory consumption is not too high (IIRC about 1,6 MB) and I think I can further reduce it.
@Markus328 commented on GitHub (May 7, 2026):
Talking about the netlink message, I also found "a bug" when using rootless nspawn containers: Aparently the seatd refuses to accept the message because of the wrong owership, the devices can work well, but the hotplug behavior is not functional, the session doesn't know when the device is plugged in. If the session starts before the sunshine, then when sunshine create the devices the session doesnt catch it, so need restart. Anyway, I think this can be fixed both outside and inside, if you use the 3rd approach to call a binary as root (the container's root) inside the container
@Markus328 commented on GitHub (May 7, 2026):
I will grab more details about my experience and ideas of how to do the per-container vuinputd instance, once I get home
@Markus328 commented on GitHub (May 8, 2026):
Well, thinking more about it I can suggest you to create a per-instance vuinputd configuration at
services.vuinputd.instances. Each instance will have its placement mode, device policy and dev name, as well asextraFlagsand so on. It will also expose anconfig.services.vuinputd.instances.<name>.pathof the virtual uinput instance. Doing this way, the vuinputd module would be agnostic of the container engine or solution, making it simple.About the implementation itself, several systemd services would run for each instance, execing it + oneshotting the chmod stuff if needed. About some isolation, its need to search a way of doing this in a more unprivileged way.
The toplevel of module
services.vuinputdwould basically source the udev rules even with no instance configured@joleuger commented on GitHub (May 8, 2026):
vuinpud makes no seat assignment and just removes the seats from the netlink message altogether. For libseat, I just used the noop plugin that just assigns everything internally to seat0 and it works fine in my case. Maybe you can give it a try:
Anyway, I created a issue https://github.com/joleuger/vuinputd/issues/15
@joleuger commented on GitHub (May 9, 2026):
Status update: As a first step to improve the experience on nix os, I have used the configuration of Markus328 to create an integration test and write some documentation for NixOS that should reduce the friction for first time users
Edit: Next step is to write a flake in the repo and update the documentation