configuration/packages/ydotoold.nix
Andrew Kvalheim a7f281f57e Add ydotool
2022-09-06 09:37:59 -07:00

32 lines
815 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 = [ "graphical-session.target" ];
description = "ydotool daemon";
serviceConfig.User = "ydotool";
serviceConfig.SupplementaryGroups = [ "uinput" ];
script = "${cfg.package}/bin/ydotoold --socket-perm 0660";
};
}
);
}