nixos: services: add audiobookshelf
This commit is contained in:
parent
7ebbb10568
commit
2dedb41a47
39
modules/nixos/services/audiobookshelf/default.nix
Normal file
39
modules/nixos/services/audiobookshelf/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
# Audiobook and podcast library
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.audiobookshelf;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.audiobookshelf = with lib; {
|
||||||
|
enable = mkEnableOption "Audiobookshelf, a self-hosted podcast manager";
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 8000;
|
||||||
|
example = 4242;
|
||||||
|
description = "The port on which Audiobookshelf will listen for incoming HTTP traffic.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.audiobookshelf = {
|
||||||
|
enable = true;
|
||||||
|
inherit (cfg) port;
|
||||||
|
|
||||||
|
group = "media";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set-up media group
|
||||||
|
users.groups.media = { };
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
audiobookshelf = {
|
||||||
|
inherit (cfg) port;
|
||||||
|
# Proxy websockets for RPC
|
||||||
|
extraConfig = {
|
||||||
|
locations."/".proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -4,6 +4,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./adblock
|
./adblock
|
||||||
./aria
|
./aria
|
||||||
|
./audiobookshelf
|
||||||
./backup
|
./backup
|
||||||
./blog
|
./blog
|
||||||
./calibre-web
|
./calibre-web
|
||||||
|
|
Loading…
Reference in a new issue