stockholm/makefu/2configs/bureautomation/office-radio/webserver.nix
2021-01-25 08:32:21 +01:00

41 lines
1.2 KiB
Nix

{ pkgs, ... }:
let
mpds = import ./mpdconfig.nix;
pkg = pkgs.office-radio;
in {
systemd.services.office-radio-appsrv = {
after = [ "network.target" ];
description = "Office Radio Appserver";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkg}/bin/office-radio";
DynamicUser = true;
ProtectSystem = true;
NoNewPrivileges = true;
ProtectKernelTunables = true;
ProtectControlGroups = true;
ProtectKernelModules = true;
RestrictAddressFamilies = "AF_INET AF_INET6 AF_UNIX AF_NETLINK";
RestrictNamespaces = true;
Restart = "always";
};
};
systemd.services.office-radio-stopper = {
after = [ "network.target" ];
description = "Office Radio Script to stop idle streams";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkg}/bin/stop-idle-streams";
DynamicUser = true;
ProtectSystem = true;
NoNewPrivileges = true;
ProtectKernelTunables = true;
ProtectControlGroups = true;
ProtectKernelModules = true;
RestrictAddressFamilies = "AF_INET AF_INET6 AF_UNIX AF_NETLINK";
RestrictNamespaces = true;
Restart = "always";
};
};
}