Compare commits

...

6 commits

Author SHA1 Message Date
Bruno BELANYI 929c8ea9b0 hosts: nixos: porthos: services: audiobookshelf
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2024-04-22 21:00:00 +02:00
Bruno BELANYI 2dedb41a47 nixos: services: add audiobookshelf 2024-04-22 21:00:00 +02:00
Bruno BELANYI 7ebbb10568 hosts: nixos: porthos: migrate podgrab 'dataDir'
I want to share it with `audiobookshelf`, so putting it in `/data/media`
makes it easier.
2024-04-22 21:00:00 +02:00
Bruno BELANYI 5df0574f41 nixos: services: podgrab: add 'dataDir' 2024-04-22 21:00:00 +02:00
Bruno BELANYI c18054cad7 nixos: services: podgrab: use 'media' group 2024-04-22 20:59:09 +02:00
Bruno BELANYI f9db06a6d4 flake: bump inputs 2024-04-22 20:58:45 +02:00
5 changed files with 73 additions and 12 deletions

View file

@ -136,11 +136,11 @@
]
},
"locked": {
"lastModified": 1712390667,
"narHash": "sha256-ebq+fJZfobqpsAdGDGpxNWSySbQejRwW9cdiil6krCo=",
"lastModified": 1713809191,
"narHash": "sha256-9Tb5JKcacjxNF1f7gsu/4l4Gxa2qflq9x1hhdl10iwM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "b787726a8413e11b074cde42704b4af32d95545c",
"rev": "e866aae5bbbcfe6798ca05d3004a4e62f1828954",
"type": "github"
},
"original": {
@ -152,11 +152,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1712439257,
"narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=",
"lastModified": 1713714899,
"narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599",
"rev": "6143fc5eeb9c4f00163267708e26191d1e918932",
"type": "github"
},
"original": {
@ -168,11 +168,11 @@
},
"nur": {
"locked": {
"lastModified": 1712485930,
"narHash": "sha256-Gx1kXJYnYENoJKWdZpTSDj9fAbnhSzp/cTpFFIXre/M=",
"lastModified": 1713810384,
"narHash": "sha256-ze9APypWwgcNXvtc+Y/In/PCGmIzm/VefrwQKG7ge7E=",
"owner": "nix-community",
"repo": "NUR",
"rev": "e4dfbd7eb86b3ac1bf5b7d5c4ca200dba5cbb5a9",
"rev": "5d454967f1d978fe45956d25ed7ee15b9910da18",
"type": "github"
},
"original": {
@ -197,11 +197,11 @@
]
},
"locked": {
"lastModified": 1712055707,
"narHash": "sha256-4XLvuSIDZJGS17xEwSrNuJLL7UjDYKGJSbK1WWX2AK8=",
"lastModified": 1713775815,
"narHash": "sha256-Wu9cdYTnGQQwtT20QQMg7jzkANKQjwBD9iccfGKkfls=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "e35aed5fda3cc79f88ed7f1795021e559582093a",
"rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4",
"type": "github"
},
"original": {

View file

@ -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

View 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;
};
};
};
};
}

View file

@ -4,6 +4,7 @@
imports = [
./adblock
./aria
./audiobookshelf
./backup
./blog
./calibre-web

View file

@ -17,6 +17,15 @@ in
'';
};
dataDir = mkOption {
type = with types; nullOr str;
default = null;
example = "/mnt/podgrab";
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;