diff --git a/mkDocs.nix b/mkDocs.nix index 2076efb..718dc69 100644 --- a/mkDocs.nix +++ b/mkDocs.nix @@ -24,9 +24,11 @@ in buildInputs = with pkgs; [pandoc]; phases = ["unpackPhase" "buildPhase"]; buildPhase = '' - tmpdir=$(mktemp -d) + #tmpdir=$(mktemp -d) + tmpdir="$out/debug" mkdir -p $out - cp -r docs/pandoc/style.css docs $out + mkdir -p $tmpdir + cp -r docs $out # Generate md docs cat ${optionsDocNixos.optionsCommonMark} | tail -n +58 >> "$tmpdir"/nixos.md diff --git a/nixarr/default.nix b/nixarr/default.nix index ff53408..24968c4 100644 --- a/nixarr/default.nix +++ b/nixarr/default.nix @@ -18,25 +18,39 @@ in { ]; options.nixarr = { - enable = mkEnableOption '' - Primarily, lets you host the "*Arrs" services optionally through a VPN. + enable = mkOption { + type = types.bool; + default = false; + description = '' + Whether or not to enable the nixarr module. Has the following features: - It is possible, _but not recommended_, to have - prowlarr/sonarr/radarr/readarr/lidarr behind a VPN, because it can cause - rate limiting issues. Generally, you should use VPN on transmission - and maybe jellyfin, depending on your setup. Also sets permissions - and creates directories. + - **Run services through a VPN:** You can run any service that this module + supports through a VPN, fx `nixarr.transmission.vpn.enable = true;` + - **Automatic Directories, Users and Permissions:** The module automatically + creates directories and users for your media library. It also sets sane + permissions. + - **State Management:** All services support state management and all state + that they manage is located by default in `/data/.state/nixarr/*` + - **Optional Automatic Port Forwarding:** This module has a UPNP module that + lets services request ports from your router automatically, if you enable it. + + It is possible, _but not recommended_, to run the "*Arrs" behind a VPN, + because it can cause rate limiting issues. Generally, you should use + VPN on transmission and maybe jellyfin, depending on your setup. - - Jellyfin - - Lidarr - - Prowlarr - - Radarr - - Readarr - - Sonarr - - Transmission + The following services are supported: - Remember to read the options. - ''; + - Jellyfin + - Lidarr + - Prowlarr + - Radarr + - Readarr + - Sonarr + - Transmission + + Remember to read the options. + ''; + }; mediaDir = mkOption { type = types.path; @@ -55,12 +69,21 @@ in { }; vpn = { - enable = mkEnableOption "Enable vpn"; + enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** [`nixarr.vpn.wgConf`](/options.html#nixarr.vpn.wgConf) + + Whether or not to enable VPN support for the services that nixarr + supports. + ''; + }; wgConf = mkOption { type = types.nullOr types.path; default = null; - description = "REQUIRED! The path to the wireguard configuration file."; + description = "The path to the wireguard configuration file."; }; dnsServers = mkOption { @@ -75,8 +98,8 @@ in { vpnTestService = { enable = mkEnableOption '' - Enable the vpn test service. Useful for testing DNS leaks or VPN - port forwarding. + the vpn test service. Useful for testing DNS leaks or if the VPN + port forwarding works correctly. ''; port = mkOption { diff --git a/nixarr/jellyfin/default.nix b/nixarr/jellyfin/default.nix index 8317bf8..121a7b2 100644 --- a/nixarr/jellyfin/default.nix +++ b/nixarr/jellyfin/default.nix @@ -10,7 +10,7 @@ with lib; let dnsServers = config.lib.vpn.dnsServers; in { options.nixarr.jellyfin = { - enable = mkEnableOption "Enable the Jellyfin service."; + enable = mkEnableOption "the Jellyfin service."; stateDir = mkOption { type = types.path; @@ -18,27 +18,35 @@ in { description = "The state directory for Jellyfin."; }; - vpn.enable = mkEnableOption '' - **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) + vpn.enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) - Route Jellyfin traffic through the VPN. - ''; + Route Jellyfin traffic through the VPN. + ''; + }; expose = { vpn = { - enable = mkEnableOption '' - **Required options:** + enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** - - [`nixarr.jellyfin.vpn.enable`](/options.html#nixarr.jellyfin.vpn.enable) - - [`nixarr.jellyfin.expose.vpn.port`](/options.html#nixarr.jellyfin.expose.vpn.port) - - [`nixarr.jellyfin.expose.vpn.accessibleFrom`](/options.html#nixarr.jellyfin.expose.vpn.accessibleFrom) + - [`nixarr.jellyfin.vpn.enable`](/options.html#nixarr.jellyfin.vpn.enable) + - [`nixarr.jellyfin.expose.vpn.port`](/options.html#nixarr.jellyfin.expose.vpn.port) + - [`nixarr.jellyfin.expose.vpn.accessibleFrom`](/options.html#nixarr.jellyfin.expose.vpn.accessibleFrom) - Expose the Jellyfin web service to the internet, allowing anyone to - access it. + Expose the Jellyfin web service to the internet, allowing anyone to + access it. - **Important:** Do _not_ enable this without setting up Jellyfin - authentication through localhost first! - ''; + **Important:** Do _not_ enable this without setting up Jellyfin + authentication through localhost first! + ''; + }; port = mkOption { type = with types; nullOr port; @@ -60,25 +68,26 @@ in { }; https = { - enable = mkEnableOption '' - **Required options:** + enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** - - [`nixarr.jellyfin.expose.https.acmeMail`](/options.html#nixarr.jellyfin.expose.https.acmeMail) - - [`nixarr.jellyfin.expose.https.domainName`](/options.html#nixarr.jellyfin.expose.https.domainName) + - [`nixarr.jellyfin.expose.https.acmeMail`](/options.html#nixarr.jellyfin.expose.https.acmeMail) + - [`nixarr.jellyfin.expose.https.domainName`](/options.html#nixarr.jellyfin.expose.https.domainName) - **Conflicting options:** [`nixarr.jellyfin.vpn.enable`](/options.html#nixarr.jellyfin.vpn.enable) + **Conflicting options:** [`nixarr.jellyfin.vpn.enable`](/options.html#nixarr.jellyfin.vpn.enable) - Expose the Jellyfin web service to the internet with https support, - allowing anyone to access it. + Expose the Jellyfin web service to the internet with https support, + allowing anyone to access it. - **Important:** Do _not_ enable this without setting up Jellyfin - authentication through localhost first! - ''; + **Important:** Do _not_ enable this without setting up Jellyfin + authentication through localhost first! + ''; + }; - - upnp.enable = mkEnableOption '' - Use UPNP to try to open ports 80 and 443 on your router. - ''; + upnp.enable = mkEnableOption "UPNP to try to open ports 80 and 443 on your router."; domainName = mkOption { type = types.nullOr types.str; diff --git a/nixarr/lidarr/default.nix b/nixarr/lidarr/default.nix index 39f42e2..8bf0417 100644 --- a/nixarr/lidarr/default.nix +++ b/nixarr/lidarr/default.nix @@ -9,7 +9,7 @@ with lib; let nixarr = config.nixarr; in { options.nixarr.lidarr = { - enable = mkEnableOption "Enable the Lidarr service."; + enable = mkEnableOption "the Lidarr service."; stateDir = mkOption { type = types.path; @@ -17,11 +17,15 @@ in { description = "The state directory for Lidarr"; }; - vpn.enable = mkEnableOption '' - **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) + vpn.enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) - Route Lidarr traffic through the VPN. - ''; + Route Lidarr traffic through the VPN. + ''; + }; }; config = mkIf cfg.enable { diff --git a/nixarr/prowlarr/default.nix b/nixarr/prowlarr/default.nix index 91eedf7..d4e0c72 100644 --- a/nixarr/prowlarr/default.nix +++ b/nixarr/prowlarr/default.nix @@ -15,7 +15,7 @@ in { ]; options.nixarr.prowlarr = { - enable = mkEnableOption "Enable the Prowlarr service."; + enable = mkEnableOption "the Prowlarr service."; stateDir = mkOption { type = types.path; @@ -23,11 +23,15 @@ in { description = "The state directory for Prowlarr."; }; - vpn.enable = mkEnableOption '' - **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) + vpn.enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) - Route Prowlarr traffic through the VPN. - ''; + Route Prowlarr traffic through the VPN. + ''; + }; }; config = mkIf cfg.enable { diff --git a/nixarr/radarr/default.nix b/nixarr/radarr/default.nix index 186f523..4878692 100644 --- a/nixarr/radarr/default.nix +++ b/nixarr/radarr/default.nix @@ -19,11 +19,15 @@ in { description = "The state directory for radarr."; }; - vpn.enable = mkEnableOption '' - **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) + vpn.enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) - Route Radarr traffic through the VPN. - ''; + Route Radarr traffic through the VPN. + ''; + }; }; config = mkIf cfg.enable { diff --git a/nixarr/readarr/default.nix b/nixarr/readarr/default.nix index dbafa49..d6a07ca 100644 --- a/nixarr/readarr/default.nix +++ b/nixarr/readarr/default.nix @@ -17,11 +17,15 @@ in { description = "The state directory for Readarr"; }; - vpn.enable = mkEnableOption '' - **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) + vpn.enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) - Route Readarr traffic through the VPN. - ''; + Route Readarr traffic through the VPN. + ''; + }; }; config = mkIf cfg.enable { diff --git a/nixarr/sonarr/default.nix b/nixarr/sonarr/default.nix index 931b9e8..3aa6ef5 100644 --- a/nixarr/sonarr/default.nix +++ b/nixarr/sonarr/default.nix @@ -23,11 +23,15 @@ in { description = "The state directory for Sonarr."; }; - vpn.enable = mkEnableOption '' - **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) + vpn.enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) - Route Sonarr traffic through the VPN. - ''; + Route Sonarr traffic through the VPN. + ''; + }; }; config = mkIf cfg.enable { diff --git a/nixarr/transmission/default.nix b/nixarr/transmission/default.nix index e2a0376..e736a21 100644 --- a/nixarr/transmission/default.nix +++ b/nixarr/transmission/default.nix @@ -11,7 +11,7 @@ with lib; let dnsServers = config.lib.vpn.dnsServers; in { options.nixarr.transmission = { - enable = mkEnableOption "Enable the Transmission service."; + enable = mkEnableOption "the Transmission service."; stateDir = mkOption { type = types.path; @@ -29,23 +29,31 @@ in { ''; }; - vpn.enable = mkEnableOption '' - **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) + vpn.enable = mkOption { + type = types.bool; + default = false; + description = '' + **Required options:** [`nixarr.vpn.enable`](/options.html#nixarr.vpn.enable) - **Recommended:** Route Transmission traffic through the VPN. - ''; + **Recommended:** Route Transmission traffic through the VPN. + ''; + }; - flood.enable = mkEnableOption "Use the flood web-UI"; + flood.enable = mkEnableOption "the flood web-UI for the transmission web-UI."; - privateTrackers = mkEnableOption '' - Disable pex and dht, which is required for some private trackers. + privateTrackers = mkOption { + type = types.bool; + default = false; + description = '' + Disable pex and dht, which is required for some private trackers. - You don't want to enable this unless a private tracker requires you - to, and some don't. All torrents from private trackers are set as - "private", and this automatically disables dht and pex for that torrent, - so it shouldn't even be a necessary rule to have, but I don't make - their rules ¯\_(ツ)_/¯. - ''; + You don't want to enable this unless a private tracker requires you + to, and some don't. All torrents from private trackers are set as + "private", and this automatically disables dht and pex for that torrent, + so it shouldn't even be a necessary rule to have, but I don't make + their rules ¯\_(ツ)_/¯. + ''; + }; messageLevel = mkOption { type = types.enum [ @@ -58,7 +66,7 @@ in { "trace" ]; default = "warn"; - description = "Sets the message level of transmission"; + description = "Sets the message level of transmission."; }; peerPort = mkOption {