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, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
let
|
||||||
|
port = 8000;
|
||||||
|
group = "media";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
users = {
|
users.users.audiobookshelf = {
|
||||||
users.audiobookshelf.isSystemUser = true;
|
isSystemUser = true;
|
||||||
users.audiobookshelf.group = "media";
|
group = group;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 8000 ];
|
networking.firewall.allowedTCPPorts = [ port ];
|
||||||
networking.firewall.allowedUDPPorts = [ 8000 ];
|
networking.firewall.allowedUDPPorts = [ port ];
|
||||||
|
|
||||||
systemd.services.audiobookshelf = {
|
systemd.services.audiobookshelf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -15,7 +19,7 @@ with pkgs;
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
WorkingDirectory = "/srv/audiobookshelf";
|
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";
|
ExecReload = "${util-linux}/bin/kill -HUP $MAINPID";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
User = config.users.users.audiobookshelf.name;
|
User = config.users.users.audiobookshelf.name;
|
||||||
|
@ -24,4 +28,5 @@ with pkgs;
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
requires = [ "network.target" ];
|
requires = [ "network.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue