nixos-config/nixos/machines/chungus/media-audiobookshelf.nix

28 lines
847 B
Nix
Raw Normal View History

2023-05-28 22:52:03 +02:00
{ config, lib, pkgs, ... }:
with pkgs;
{
users = {
users.audiobookshelf.isSystemUser = true;
users.audiobookshelf.group = "media";
};
2023-05-28 23:12:34 +02:00
networking.firewall.allowedTCPPorts = [ 8000 ];
networking.firewall.allowedUDPPorts = [ 8000 ];
2023-05-28 22:52:03 +02:00
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" ];
};
}