Simplify nixedo modules

This commit is contained in:
Oliver Davies 2025-04-19 11:45:23 +01:00
parent 791d206764
commit 828985d76f
6 changed files with 102 additions and 154 deletions

View file

@ -1,26 +1,17 @@
{ config, lib, ... }:
{ config, ... }:
with lib;
let
cfg = config.nixosModules.audiobookshelf;
in
{
options.nixosModules.audiobookshelf.enable = mkEnableOption "Enable audiobookshelf";
services = {
audiobookshelf = {
enable = true;
config = mkIf cfg.enable {
services = {
audiobookshelf = {
enable = true;
port = 4001;
};
port = 4001;
};
caddy.virtualHosts."audiobookshelf.oliverdavies.uk" = {
useACMEHost = "oliverdavies.uk";
caddy.virtualHosts."audiobookshelf.oliverdavies.uk" = {
useACMEHost = "oliverdavies.uk";
extraConfig = "reverse_proxy localhost:${toString config.services.audiobookshelf.port}";
};
extraConfig = "reverse_proxy localhost:${toString config.services.audiobookshelf.port}";
};
};
}