# manages and downloads films { config, lib, pkgs, ... }: let cfg = config.my.profiles.audiobookshelf; hostName = config.networking.hostName; domain = config.networking.domain; in { options.my.profiles.audiobookshelf = with lib; { enable = mkEnableOption "Audio Book Service"; }; config = lib.mkIf cfg.enable { services.audiobookshelf = { enable = true; openFirewall = true; port = 63834; host = "0.0.0.0"; }; environment.systemPackages = with pkgs; [ audiobookshelf ]; my.homepage.services = [ { group = "Media"; name = "Audiobookshelf"; description = "Audiobooks and podcasts"; href = "http://${domain}:63834"; icon = "audiobookshelf.png"; } ]; systemd.services.audiobookshelf = { after = [ "network-online.target" ]; }; }; }