2021-09-22 15:38:15 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.weylus;
|
|
|
|
in
|
|
|
|
{
|
2024-05-15 15:35:15 +00:00
|
|
|
options.programs.weylus = with lib.types; {
|
|
|
|
enable = lib.mkEnableOption "weylus, which turns your smart phone into a graphic tablet/touch screen for your computer";
|
2021-09-22 15:38:15 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
openFirewall = lib.mkOption {
|
2021-09-22 15:38:15 +00:00
|
|
|
type = bool;
|
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2021-09-22 15:38:15 +00:00
|
|
|
Open ports needed for the functionality of the program.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
users = lib.mkOption {
|
2021-09-22 15:38:15 +00:00
|
|
|
type = listOf str;
|
|
|
|
default = [ ];
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2021-09-22 15:38:15 +00:00
|
|
|
To enable stylus and multi-touch support, the user you're going to use must be added to this list.
|
|
|
|
These users can synthesize input events system-wide, even when another user is logged in - untrusted users should not be added.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
package = lib.mkPackageOption pkgs "weylus" { };
|
2021-09-22 15:38:15 +00:00
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
networking.firewall = lib.mkIf cfg.openFirewall {
|
2021-09-22 15:38:15 +00:00
|
|
|
allowedTCPPorts = [ 1701 9001 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.uinput.enable = true;
|
|
|
|
|
|
|
|
users.groups.uinput.members = cfg.users;
|
|
|
|
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
};
|
|
|
|
}
|