diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2021-09-21 22:04:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-21 22:04:38 +0200 |
commit | f18f2d87f36316155345e764f693b42baac027ee (patch) | |
tree | 3167630b0c7318011418f5a84600a40a49186e41 /nixos | |
parent | cbd06e48a60a5c4d5048b3ea5ac8ff83f2d0004e (diff) | |
parent | 525846372100f5c43a0fd27866995ab89d05fc2e (diff) | |
download | nixlib-f18f2d87f36316155345e764f693b42baac027ee.tar nixlib-f18f2d87f36316155345e764f693b42baac027ee.tar.gz nixlib-f18f2d87f36316155345e764f693b42baac027ee.tar.bz2 nixlib-f18f2d87f36316155345e764f693b42baac027ee.tar.lz nixlib-f18f2d87f36316155345e764f693b42baac027ee.tar.xz nixlib-f18f2d87f36316155345e764f693b42baac027ee.tar.zst nixlib-f18f2d87f36316155345e764f693b42baac027ee.zip |
Merge pull request #135284 from legendofmiracles/weylus
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/weylus.nix | 47 |
2 files changed, 48 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index b212b81f29d5..19e9f5a27bed 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -202,6 +202,7 @@ ./programs/vim.nix ./programs/wavemon.nix ./programs/waybar.nix + ./programs/weylus.nix ./programs/wireshark.nix ./programs/wshowkeys.nix ./programs/xfs_quota.nix diff --git a/nixos/modules/programs/weylus.nix b/nixos/modules/programs/weylus.nix new file mode 100644 index 000000000000..ea92c77e7c32 --- /dev/null +++ b/nixos/modules/programs/weylus.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.weylus; +in +{ + options.programs.weylus = with types; { + enable = mkEnableOption "weylus"; + + openFirewall = mkOption { + type = bool; + default = false; + description = '' + Open ports needed for the functionality of the program. + ''; + }; + + users = mkOption { + type = listOf str; + default = [ ]; + description = '' + 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. + ''; + }; + + package = mkOption { + type = package; + default = pkgs.weylus; + defaultText = "pkgs.weylus"; + description = "Weylus package to install."; + }; + }; + config = mkIf cfg.enable { + networking.firewall = mkIf cfg.openFirewall { + allowedTCPPorts = [ 1701 9001 ]; + }; + + hardware.uinput.enable = true; + + users.groups.uinput.members = cfg.users; + + environment.systemPackages = [ cfg.package ]; + }; +} |