mirror of
https://github.com/nix-community/home-manager
synced 2024-11-10 21:29:48 +01:00
arrpc: add module
This commit is contained in:
parent
13dbf2623d
commit
7b4ea8d82f
3 changed files with 46 additions and 0 deletions
|
@ -1401,6 +1401,12 @@ in {
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
time = "2024-02-05T22:33:54+00:00";
|
||||||
|
message = ''
|
||||||
|
A new module is available: 'services.arrpc'
|
||||||
|
'';
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,6 +251,7 @@ let
|
||||||
./programs/zsh.nix
|
./programs/zsh.nix
|
||||||
./programs/zsh/prezto.nix
|
./programs/zsh/prezto.nix
|
||||||
./programs/zsh/zsh-abbr.nix
|
./programs/zsh/zsh-abbr.nix
|
||||||
|
./services/arrpc.nix
|
||||||
./services/autorandr.nix
|
./services/autorandr.nix
|
||||||
./services/avizo.nix
|
./services/avizo.nix
|
||||||
./services/barrier.nix
|
./services/barrier.nix
|
||||||
|
|
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…
Reference in a new issue