27 lines
847 B
Nix
27 lines
847 B
Nix
{ config, lib, pkgs, ... }:
|
|
with pkgs;
|
|
{
|
|
users = {
|
|
users.audiobookshelf.isSystemUser = true;
|
|
users.audiobookshelf.group = "media";
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [ 8000 ];
|
|
networking.firewall.allowedUDPPorts = [ 8000 ];
|
|
|
|
systemd.services.audiobookshelf = {
|
|
enable = true;
|
|
description = "Self-hosted audiobook server for managing and playing audiobooks";
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
WorkingDirectory = "/srv/audiobookshelf";
|
|
ExecStart = "${unstable.audiobookshelf}/bin/audiobookshelf --port 8000";
|
|
ExecReload = "${util-linux}/bin/kill -HUP $MAINPID";
|
|
Restart = "always";
|
|
User = config.users.users.audiobookshelf.name;
|
|
Group = config.users.users.audiobookshelf.group;
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
requires = [ "network.target" ];
|
|
};
|
|
}
|