mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-05 12:02:47 +00:00
9de9f6062c
Enable service when services.xow.enable is set to true. Load xow's modprobe blacklist to make sure the dongle isn't captured by the wrong driver.
21 lines
490 B
Nix
21 lines
490 B
Nix
{ 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;
|
|
|
|
boot.extraModprobeConfig = lib.readFile "${pkgs.xow}/lib/modprobe.d/xow-blacklist.conf";
|
|
|
|
systemd.packages = [ pkgs.xow ];
|
|
systemd.services.xow.wantedBy = [ "multi-user.target" ];
|
|
|
|
services.udev.packages = [ pkgs.xow ];
|
|
};
|
|
}
|