Compare commits
5 commits
4a01a50532
...
d83384e6bb
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | d83384e6bb | ||
Bruno BELANYI | fc33906fa0 | ||
Bruno BELANYI | 135dd86d7e | ||
Bruno BELANYI | 408ae6bffd | ||
Bruno BELANYI | 9564df4acb |
|
@ -10,6 +10,11 @@ in
|
|||
adblock = {
|
||||
enable = true;
|
||||
};
|
||||
# Audiobook and podcast library
|
||||
audiobookshelf = {
|
||||
enable = true;
|
||||
port = 9599;
|
||||
};
|
||||
# Backblaze B2 backup
|
||||
backup = {
|
||||
enable = true;
|
||||
|
@ -134,6 +139,7 @@ in
|
|||
podgrab = {
|
||||
enable = true;
|
||||
passwordFile = secrets."podgrab/password".path;
|
||||
dataDir = "/data/media/podcasts";
|
||||
port = 9598;
|
||||
};
|
||||
# Regular backups
|
||||
|
|
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 = [
|
||||
./adblock
|
||||
./aria
|
||||
./audiobookshelf
|
||||
./backup
|
||||
./blog
|
||||
./calibre-web
|
||||
|
|
|
@ -17,6 +17,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
dataDir = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
example = "/mnt/paperless";
|
||||
description = ''
|
||||
Path to the directory to store the podcasts. Use default if null
|
||||
'';
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 8080;
|
||||
|
@ -29,8 +38,14 @@ in
|
|||
services.podgrab = {
|
||||
enable = true;
|
||||
inherit (cfg) passwordFile port;
|
||||
|
||||
group = "media";
|
||||
dataDirectory = lib.mkIf (cfg.dataDir != null) cfg.dataDir;
|
||||
};
|
||||
|
||||
# Set-up media group
|
||||
users.groups.media = { };
|
||||
|
||||
my.services.nginx.virtualHosts = {
|
||||
podgrab = {
|
||||
inherit (cfg) port;
|
||||
|
|
Loading…
Reference in a new issue