summaryrefslogtreecommitdiffstats
path: root/nixos/modules
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2020-03-31 20:41:17 +0200
committerGitHub <noreply@github.com>2020-03-31 20:41:17 +0200
commit0cb43d3151c2df2f36d85ebeeb58f468fae89159 (patch)
tree2877f3d732874a4f46f165b68d88c724aedf9ebf /nixos/modules
parent08306f3f2632058da1af5ce894f6c0a9409ff74e (diff)
parent081ed8f0126178a0d2c624fd4bd946704db7fc6a (diff)
Merge pull request #83732 from jansol/xow
xow: init at 0.4
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/hardware/uinput.nix19
-rw-r--r--nixos/modules/module-list.nix2
-rw-r--r--nixos/modules/services/hardware/xow.nix17
3 files changed, 38 insertions, 0 deletions
diff --git a/nixos/modules/hardware/uinput.nix b/nixos/modules/hardware/uinput.nix
new file mode 100644
index 000000000000..55e86bfa6bdb
--- /dev/null
+++ b/nixos/modules/hardware/uinput.nix
@@ -0,0 +1,19 @@
+{ config, pkgs, lib, ... }:
+
+let
+ cfg = config.hardware.uinput;
+in {
+ options.hardware.uinput = {
+ enable = lib.mkEnableOption "uinput support";
+ };
+
+ config = lib.mkIf cfg.enable {
+ boot.kernelModules = [ "uinput" ];
+
+ users.groups.uinput = {};
+
+ services.udev.extraRules = ''
+ SUBSYSTEM=="misc", KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
+ '';
+ };
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index dafece285b64..7633f1ca0ad5 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -65,6 +65,7 @@
./hardware/usb-wwan.nix
./hardware/onlykey.nix
./hardware/wooting.nix
+ ./hardware/uinput.nix
./hardware/video/amdgpu.nix
./hardware/video/amdgpu-pro.nix
./hardware/video/ati.nix
@@ -368,6 +369,7 @@
./services/hardware/thermald.nix
./services/hardware/undervolt.nix
./services/hardware/vdr.nix
+ ./services/hardware/xow.nix
./services/logging/SystemdJournal2Gelf.nix
./services/logging/awstats.nix
./services/logging/fluentd.nix
diff --git a/nixos/modules/services/hardware/xow.nix b/nixos/modules/services/hardware/xow.nix
new file mode 100644
index 000000000000..a18d60ad83be
--- /dev/null
+++ b/nixos/modules/services/hardware/xow.nix
@@ -0,0 +1,17 @@
+{ config, pkgs, lib, ... }:
+
+let
+ cfg = config.services.hardware.xow;
+in {
+ options.services.hardware.xow = {
+ enable = lib.mkEnableOption "xow as a systemd service";
+ };
+
+ config = lib.mkIf cfg.enable {
+ hardware.uinput.enable = true;
+
+ systemd.packages = [ pkgs.xow ];
+
+ services.udev.packages = [ pkgs.xow ];
+ };
+}