mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-13 04:21:08 +01:00
arrpc: add module
This commit is contained in:
parent
13dbf2623d
commit
7b4ea8d82f
3 changed files with 46 additions and 0 deletions
39
modules/services/arrpc.nix
Normal file
39
modules/services/arrpc.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ 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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue