configuration/packages/ydotoold.nix
Andrew Kvalheim c7c5265846 Resolve lints
2023-01-20 20:45:13 -08:00

30 lines
801 B
Nix

# Requires uinput group created by KMonad module
{ config, lib, pkgs, ... }:
let
cfg = config.services.ydotoold;
in
{
options.services.ydotoold = {
enable = lib.mkEnableOption "ydotool daemon";
package = lib.mkOption { type = lib.types.package; default = pkgs.ydotool; };
};
config = lib.mkIf cfg.enable {
users.groups.ydotool = { };
users.users.ydotool = {
description = "ydotool daemon";
group = "ydotool";
isSystemUser = true;
};
systemd.services.ydotoold = {
wantedBy = [ "multi-user.target" ]; # Pending NixOS/nixpkgs#169143
description = "ydotool daemon";
serviceConfig.User = "ydotool";
serviceConfig.SupplementaryGroups = [ "uinput" ];
script = "${cfg.package}/bin/ydotoold --socket-perm 0660";
};
};
}