summary refs log tree commit diff
path: root/nixos/modules/services/hardware/xow.nix
diff options
context:
space:
mode:
authorPhilipp Middendorf <middendorf@plapadoo.de>2019-12-22 21:10:48 +0100
committerJan Solanti <jhs@psonet.com>2020-03-30 00:16:21 +0300
commit35035a543c9ed2e3383ecfdf6b9c610e20c3223c (patch)
treeb1d580c9f5eece946f7bab2ab32afccc2439e5f6 /nixos/modules/services/hardware/xow.nix
parent1992768157d7456748ec28e01c8952cf09b53fbf (diff)
downloadnixpkgs-35035a543c9ed2e3383ecfdf6b9c610e20c3223c.tar
nixpkgs-35035a543c9ed2e3383ecfdf6b9c610e20c3223c.tar.gz
nixpkgs-35035a543c9ed2e3383ecfdf6b9c610e20c3223c.tar.bz2
nixpkgs-35035a543c9ed2e3383ecfdf6b9c610e20c3223c.tar.lz
nixpkgs-35035a543c9ed2e3383ecfdf6b9c610e20c3223c.tar.xz
nixpkgs-35035a543c9ed2e3383ecfdf6b9c610e20c3223c.tar.zst
nixpkgs-35035a543c9ed2e3383ecfdf6b9c610e20c3223c.zip
xow: init at 0.2
Diffstat (limited to 'nixos/modules/services/hardware/xow.nix')
-rw-r--r--nixos/modules/services/hardware/xow.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/modules/services/hardware/xow.nix b/nixos/modules/services/hardware/xow.nix
new file mode 100644
index 00000000000..a97dd5c870d
--- /dev/null
+++ b/nixos/modules/services/hardware/xow.nix
@@ -0,0 +1,30 @@
+{ config, pkgs, lib, ... }:
+
+let
+  cfg = config.services.hardware.xow;
+in {
+  options.services.hardware.xow = {
+    enable = lib.mkEnableOption "Whether to enable xow or not.";
+  };
+
+  config = lib.mkIf cfg.enable {
+    hardware.uinput.enable = true;
+
+    users.users.xow = {
+      group = "uinput";
+      isSystemUser = true;
+    };
+
+    systemd.services.xow = {
+      wantedBy = [ "multi-user.target" ];
+      description = "Xbox One Wireless Dongle Driver";
+      after = [ "systemd-udev-settle.service" ];
+      serviceConfig = {
+        ExecStart = ''
+          ${pkgs.xow}/bin/xow
+        '';
+        User = "xow";
+      };
+    };
+  };
+}