clouvider-fra01: add ts3spotifybot
This commit is contained in:
parent
413c38e348
commit
c7df81d6a1
2 changed files with 34 additions and 0 deletions
|
@ -32,6 +32,7 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
../lib/zfs.nix
|
../lib/zfs.nix
|
||||||
../lib/bgp.nix
|
../lib/bgp.nix
|
||||||
|
../lib/ts3spotifybot.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [
|
boot.initrd.availableKernelModules = [
|
||||||
|
|
33
ops/nixos/lib/ts3spotifybot.nix
Normal file
33
ops/nixos/lib/ts3spotifybot.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{ depot, pkgs, ... }:
|
||||||
|
let
|
||||||
|
service = {
|
||||||
|
wantedBy = [ "ts3musicbot.target" ];
|
||||||
|
partOf = [ "ts3musicbot.target" ];
|
||||||
|
};
|
||||||
|
audioService = service // {
|
||||||
|
after = [ "ts3musicbot-pulseaudio.service" ];
|
||||||
|
bindsTo = [ "ts3musicbot-pulseaudio.service" ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
users.users.ts3musicbot = {
|
||||||
|
createHome = true;
|
||||||
|
home = "/var/lib/ts3musicbot";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.targets.ts3musicbot = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
};
|
||||||
|
systemd.services.ts3musicbot-pulseaudio = service // {
|
||||||
|
serviceConfig.ExecStart = "${pkgs.pulseaudio}/bin/pulseaudio --start --daemonize=false --load=\"module-null-sink sink_name=Loop\" --load=\"module-null-sink sink_name=The Void\" --load=\"module-native-protocol-unix\"";
|
||||||
|
serviceConfig.User = "ts3musicbot";
|
||||||
|
};
|
||||||
|
systemd.services.ts3musicbot-spotifyd = audioService // {
|
||||||
|
serviceConfig.ExecStart = "${pkgs.spotifyd}/bin/spotifyd --no-daemon --config-path ${depot.ops.secrets.spotifyd}";
|
||||||
|
serviceConfig.User = "ts3musicbot";
|
||||||
|
};
|
||||||
|
systemd.services.ts3musicbot-teamspeak = audioService // {
|
||||||
|
serviceConfig.ExecStart = "${pkgs.xvfb_run}/bin/xvfb-run -d -s \"-screen 0 1280x1024x24\" ${pkgs.teamspeak_client}/bin/ts3client";
|
||||||
|
serviceConfig.User = "ts3musicbot";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue