diff --git a/docs/README.md b/docs/README.md index 44a6dad..01be06f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -23,7 +23,7 @@ _Replaces Sonarr, Radarr, Seerr, and more._ ### Quick Links -
Installation Guideinstallation-guide.md
Configurationconfiguration
Developer Guidedeveloper-guide.md
Troubleshootingtroubleshooting.md
Advanced Featuresadvanced-features
Import Existing Mediaimporting-existing-media.md
+
Installation Guideinstallation
Configurationconfiguration
Developer Guidedeveloper-guide.md
Troubleshootingtroubleshooting.md
Advanced Featuresadvanced-features
Import Existing Mediaimporting-existing-media.md
## Support MediaManager & Maximilian Dorninger diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 716c124..e50bb85 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -1,7 +1,9 @@ # Table of contents * [MediaManager](README.md) -* [Installation Guide](installation-guide.md) +* [Installation Guide](installation/README.md) + * [Docker (recommended)](installation/docker.md) + * [Nix Flakes \[Community\]](installation/flakes.md) * [Importing existing media](importing-existing-media.md) * [Usage](usage.md) * [Configuration](configuration/README.md) diff --git a/docs/installation/README.md b/docs/installation/README.md new file mode 100644 index 0000000..e8a9bc6 --- /dev/null +++ b/docs/installation/README.md @@ -0,0 +1,19 @@ +# Installation Guide + +The recommended way to install and run Media Manager is using Docker and Docker Compose. Other installation + methods are not officially supported, but listed here for convenience. + + + + + + + + + + + + + + +
Docker Compose (recommended)docker.md
Nix Flakes [Community]flakes.md
\ No newline at end of file diff --git a/docs/installation-guide.md b/docs/installation/docker.md similarity index 96% rename from docs/installation-guide.md rename to docs/installation/docker.md index 0b7bc05..b4897f9 100644 --- a/docs/installation-guide.md +++ b/docs/installation/docker.md @@ -1,6 +1,4 @@ -# Installation Guide - -The recommended way to install and run Media Manager is using Docker and Docker Compose. +# Docker ## Prerequisites diff --git a/docs/installation/flakes.md b/docs/installation/flakes.md new file mode 100644 index 0000000..56f012d --- /dev/null +++ b/docs/installation/flakes.md @@ -0,0 +1,127 @@ +# Nix Flakes + +{% hint style="note" %} +This is a community contribution and not officially supported by the MediaManager team, but included here for convenience. +{% endhint %} + +*Please report issues with this method at the [corresponding GitHub repository](https://github.com/strangeglyph/mediamanager-nix).* + + +## Prerequisites + +This guide assumes that your system is a flakes-based NixOS installation. Hosting MediaManager on a subpath (e.g. `yourdomain.com/mediamanager`) is currently not supported, though contributions to add support are welcome. + +## Importing the community flake + +To use the community-provided flake and module, first import it in your own flake, for example: + +```nix +{ + description = "An example NixOS configuration"; + + inputs = { + nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; }; + + mediamanager-nix = { + url = "github:strangeglyph/mediamanager-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs@{ + nixpkgs, + mediamanager-nix, + ... + }: { + nixosConfigurations.your-system = nixpkgs.lib.nixosSystem { + modules = [ + mediamanager-nix.nixosModules.default + ]; + }; + }; +} +``` + +## Configuration + +The flake provides a simple module to set up a MediaManager systemd service. To enable it, set + +```nix +{ + config = { + services.media-manager = { + enable = true; + }; + }; +} +``` + +You will either want to set `services.media-manager.dataDir`, which will provide sensible defaults for the settings +`misc.{image,movie,tv,torrent}_directory`, or provide specific paths yourself. + +The host and port that MediaManager listens on can be set using `services.media-manager.{host,port}`. + +To configure MediaManager, use `services.media-manager.settings`, which follows the same structure as the MediaManager +`config.toml`. To provision secrets, set `services.media-manager.environmentFile` to a protected file, for example one +provided by [agenix](https://github.com/ryantm/agenix) or [sops-nix](https://github.com/Mic92/sops-nix). +See [Configuration](Configuration.md#configuring-secrets) for guidance on using environment variables. + + +{% hint style="warning" %} + Do not place secrets in the nix store, as it is world-readable. +{% endhint %} + +## Automatic Postgres Setup + +As a convenience feature, the module provides a simple Postgres setup that can be enabled with `services.media-manager.postgres.enable`. This sets up a database user named `services.media-manager.postgres.user` and a database with the same name. Provided the user of the systemd service wasn't changed, authentication should work automatically for unix socket connections (the default mediamanager-nix settings). + +For advanced setups, please refer to the NixOS manual. + +## Example Configuration + +Here is a minimal complete flake for a MediaManager setup: + +```nix +{ + description = "An example NixOS configuration"; + + inputs = { + nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; }; + mediamanager-nix = { + url = "github:strangeglyph/mediamanager-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = inputs@{ + nixpkgs, + mediamanager-nix, + ... + }: { + nixosConfigurations.your-system = nixpkgs.lib.nixosSystem { + imports = [ + mediamanager-nix.nixosModules.default + ]; + + config = { + services.media-manager = { + enable = true; + postgres.enable = true; + port = 12345; + dataDir = "/tmp"; + settings = { + misc.frontend_url = "http://[::1]:12345"; + }; + }; + + systemd.tmpfiles.settings."10-mediamanager" = { + "/tmp/movies".d = { user = config.services.media-manager.user; }; + "/tmp/shows".d = { user = config.services.media-manager.user; }; + "/tmp/images".d = { user = config.services.media-manager.user; }; + "/tmp/torrents".d = { user = config.services.media-manager.user; }; + }; + }; + }; + }; +} +``` \ No newline at end of file