update media-audiobookshelf.nix
This commit is contained in:
parent
d8e7484dd3
commit
31f8f1a55c
1 changed files with 11 additions and 6 deletions
|
@ -1,13 +1,17 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with pkgs;
|
||||
let
|
||||
port = 8000;
|
||||
group = "media";
|
||||
in
|
||||
{
|
||||
users = {
|
||||
users.audiobookshelf.isSystemUser = true;
|
||||
users.audiobookshelf.group = "media";
|
||||
users.users.audiobookshelf = {
|
||||
isSystemUser = true;
|
||||
group = group;
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 8000 ];
|
||||
networking.firewall.allowedUDPPorts = [ 8000 ];
|
||||
networking.firewall.allowedTCPPorts = [ port ];
|
||||
networking.firewall.allowedUDPPorts = [ port ];
|
||||
|
||||
systemd.services.audiobookshelf = {
|
||||
enable = true;
|
||||
|
@ -15,7 +19,7 @@ with pkgs;
|
|||
serviceConfig = {
|
||||
Type = "simple";
|
||||
WorkingDirectory = "/srv/audiobookshelf";
|
||||
ExecStart = "${unstable.audiobookshelf}/bin/audiobookshelf --port 8000";
|
||||
ExecStart = "${unstable.audiobookshelf}/bin/audiobookshelf --port ${toString port}";
|
||||
ExecReload = "${util-linux}/bin/kill -HUP $MAINPID";
|
||||
Restart = "always";
|
||||
User = config.users.users.audiobookshelf.name;
|
||||
|
@ -24,4 +28,5 @@ with pkgs;
|
|||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "network.target" ];
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue