9 cfg = config.services.handheld-daemon;
12 options.services.handheld-daemon = {
13 enable = mkEnableOption "Handheld Daemon";
14 package = mkPackageOption pkgs "handheld-daemon" { };
17 enable = mkEnableOption "Handheld Daemon UI";
18 package = mkPackageOption pkgs "handheld-daemon-ui" { };
24 The user to run Handheld Daemon with.
29 config = mkIf cfg.enable {
30 services.handheld-daemon.ui.enable = mkDefault true;
31 environment.systemPackages = [
33 ] ++ lib.optional cfg.ui.enable cfg.ui.package;
34 services.udev.packages = [ cfg.package ];
35 systemd.packages = [ cfg.package ];
37 systemd.services.handheld-daemon = {
38 description = "Handheld Daemon";
40 wantedBy = [ "multi-user.target" ];
42 restartIfChanged = true;
44 path = mkIf cfg.ui.enable [
50 ExecStart = "${lib.getExe cfg.package} --user ${cfg.user}";
52 Restart = "on-failure";
58 meta.maintainers = [ maintainers.appsforartists ];