depot/third_party/home-manager/modules/services/arrpc.nix
Default email 4d19ca4703 Project import generated by Copybara.
GitOrigin-RevId: a7117efb3725e6197dd95424136f79147aa35e5b
2024-06-04 11:23:39 -07:00

39 lines
920 B
Nix

{ config, pkgs, lib, ... }:
let
inherit (lib) mkIf mkOption mkPackageOption mkEnableOption types;
cfg = config.services.arrpc;
in {
meta.maintainers = [ lib.maintainers.NotAShelf ];
options.services.arrpc = {
enable = mkEnableOption "arrpc";
package = mkPackageOption pkgs "arrpc" { };
systemdTarget = mkOption {
type = types.str;
default = "graphical-session.target";
example = "sway-session.target";
description = ''
Systemd target to bind to.
'';
};
};
config = mkIf cfg.enable {
systemd.user.services.arRPC = {
Unit = {
Description =
"Discord Rich Presence for browsers, and some custom clients";
PartOf = [ "graphical-session.target" ];
};
Service = {
ExecStart = lib.getExe cfg.package;
Restart = "always";
};
Install.WantedBy = [ cfg.systemdTarget ];
};
};
}