Added Configuration for Audiobookshelf (does not evaluate yet)
Some checks are pending
/ Check NixOS Configuration (push) Waiting to run

This commit is contained in:
Kaybee 2024-11-29 03:15:56 +01:00
parent b4d82ccb9c
commit 57a2d11ae6
Signed by: kb01
SSH key fingerprint: SHA256:gP6opHVPcRQWO2nBbCcsXmXLtGrxzdRbP+frT4AAJFs
4 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,29 @@
{
inputs,
config,
lib,
pkgs,
system,
...
}:
let
cfg = config.services.nas;
in
{
config = lib.mkIf (cfg.enable && cfg.servers.audiobookshelf.enable) {
services.audiobookshelf = {
enable = true;
port = 63001;
};
services.traefik.dynamicConfigOptions = {
http.routers.audiobookshelf.entrypoints = "websecure";
http.routers.audiobookshelf.tls = true;
http.routers.audiobookshelf.rule = "Host(`audiobookshelf.U3ncSovm`)";
http.routers.audiobookshelf.service = "audiobookshelf";
services.audiobookshelf.loadBalancer.servers = [ { url = "http://localhost:63001"; } ];
};
};
}

View file

@ -0,0 +1,29 @@
{ inputs, config, lib, pkgs, ... }:
let
cfg = config.services.nas;
in
{
imports = [
./traefik-proxy.nix
./audiobookshelf.nix
];
options.services.nas = {
enable = lib.mkOption {
type = with lib.types; uniq bool;
default = false;
description = "Enable NAS Server Configuration";
};
useTraefik.enable = lib.mkOption {
type = with lib.types; uniq bool;
default = true;
description = "Enables Traefik Reverese Proxy";
};
servers.audiobookshelf.enable = lib.mkOption {
type = with lib.types; uniq bool;
default = false;
description = "Audiobookshelf Server";
};
};
}

View file

@ -0,0 +1,24 @@
{
inputs,
config,
lib,
pkgs,
system,
...
}:
let
cfg = config.services.nas;
in
{
config = lib.mkIf (cfg.enable && cfg.useTraefik.enable) {
services.traefik = {
enable = true;
staticConfigOptions = {
entryPoints.web.address = ":80";
entryPoints.websecure.address = ":443";
};
};
};
}

View file

@ -45,6 +45,12 @@
git git
]; ];
# Enable NAS Functionality
services.nas = {
enable = true;
servers.audiobookshelf = true;
};
# SSH and Mosh # SSH and Mosh
services.openssh = { services.openssh = {
enable = true; enable = true;