nixpkgs/nixos/modules/services/hardware/handheld-daemon.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
942 B
Nix
Raw Normal View History

2024-01-02 00:18:45 +00:00
{ config
, lib
, pkgs
, ...
}:
with lib; let
cfg = config.services.handheld-daemon;
2024-01-02 00:18:45 +00:00
in
{
options.services.handheld-daemon = {
2024-01-02 00:18:45 +00:00
enable = mkEnableOption "Enable Handheld Daemon";
user = mkOption {
type = types.str;
description = lib.mdDoc ''
The user to run Handheld Daemon with.
'';
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.handheld-daemon ];
services.udev.packages = [ pkgs.handheld-daemon ];
systemd.packages = [ pkgs.handheld-daemon ];
systemd.services.handheld-daemon = {
2024-01-02 00:18:45 +00:00
description = "Handheld Daemon";
wantedBy = [ "multi-user.target" ];
restartIfChanged = true;
serviceConfig = {
ExecStart = "${ pkgs.handheld-daemon }/bin/hhd --user ${ cfg.user }";
Nice = "-12";
Restart = "on-failure";
RestartSec = "10";
};
};
};
meta.maintainers = [ maintainers.appsforartists ];
}