1 { config, lib, pkgs, ... }:
4 cfg = config.programs.weylus;
7 options.programs.weylus = with lib.types; {
8 enable = lib.mkEnableOption "weylus, which turns your smart phone into a graphic tablet/touch screen for your computer";
10 openFirewall = lib.mkOption {
14 Open ports needed for the functionality of the program.
18 users = lib.mkOption {
22 To enable stylus and multi-touch support, the user you're going to use must be added to this list.
23 These users can synthesize input events system-wide, even when another user is logged in - untrusted users should not be added.
27 package = lib.mkPackageOption pkgs "weylus" { };
29 config = lib.mkIf cfg.enable {
30 networking.firewall = lib.mkIf cfg.openFirewall {
31 allowedTCPPorts = [ 1701 9001 ];
34 hardware.uinput.enable = true;
36 users.groups.uinput.members = cfg.users;
38 environment.systemPackages = [ cfg.package ];