Added Configuration for Audiobookshelf (does not evaluate yet)
Some checks are pending
/ Check NixOS Configuration (push) Waiting to run
Some checks are pending
/ Check NixOS Configuration (push) Waiting to run
This commit is contained in:
parent
b4d82ccb9c
commit
57a2d11ae6
4 changed files with 88 additions and 0 deletions
29
modules/nixos/services/nas/audiobookshelf.nix
Normal file
29
modules/nixos/services/nas/audiobookshelf.nix
Normal 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"; } ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
29
modules/nixos/services/nas/default.nix
Normal file
29
modules/nixos/services/nas/default.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
24
modules/nixos/services/nas/traefik-proxy.nix
Normal file
24
modules/nixos/services/nas/traefik-proxy.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue