mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 21:54:00 +02:00
docs: add installation instructions for nix flake (#361)
Following the discussion in #329 and #115, here's a doc section on using nix flakes to install MediaManager. Co-authored-by: lschuetze <lschuetze@mpi-sws.org>
This commit is contained in:
@@ -23,7 +23,7 @@ _Replaces Sonarr, Radarr, Seerr, and more._
|
||||
|
||||
### Quick Links
|
||||
|
||||
<table data-view="cards" data-full-width="true"><thead><tr><th align="center"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td align="center">Installation Guide</td><td><a href="installation-guide.md">installation-guide.md</a></td></tr><tr><td align="center">Configuration</td><td><a href="configuration/">configuration</a></td></tr><tr><td align="center">Developer Guide</td><td><a href="developer-guide.md">developer-guide.md</a></td></tr><tr><td align="center">Troubleshooting</td><td><a href="troubleshooting.md">troubleshooting.md</a></td></tr><tr><td align="center">Advanced Features</td><td><a href="advanced-features/">advanced-features</a></td></tr><tr><td align="center">Import Existing Media</td><td><a href="importing-existing-media.md">importing-existing-media.md</a></td></tr></tbody></table>
|
||||
<table data-view="cards" data-full-width="true"><thead><tr><th align="center"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td align="center">Installation Guide</td><td><a href="installation/">installation</a></td></tr><tr><td align="center">Configuration</td><td><a href="configuration/">configuration</a></td></tr><tr><td align="center">Developer Guide</td><td><a href="developer-guide.md">developer-guide.md</a></td></tr><tr><td align="center">Troubleshooting</td><td><a href="troubleshooting.md">troubleshooting.md</a></td></tr><tr><td align="center">Advanced Features</td><td><a href="advanced-features/">advanced-features</a></td></tr><tr><td align="center">Import Existing Media</td><td><a href="importing-existing-media.md">importing-existing-media.md</a></td></tr></tbody></table>
|
||||
|
||||
## Support MediaManager & Maximilian Dorninger
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
19
docs/installation/README.md
Normal file
19
docs/installation/README.md
Normal file
@@ -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.
|
||||
|
||||
|
||||
<table data-view="cards" data-full-width="true">
|
||||
<thead><tr><th align="center"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">Docker Compose (recommended)</td>
|
||||
<td><a href="/installation/docker.md">docker.md</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">Nix Flakes [Community]</td>
|
||||
<td><a href="/installation/flakes.md">flakes.md</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1,6 +1,4 @@
|
||||
# Installation Guide
|
||||
|
||||
The recommended way to install and run Media Manager is using Docker and Docker Compose.
|
||||
# Docker
|
||||
|
||||
## Prerequisites
|
||||
|
||||
127
docs/installation/flakes.md
Normal file
127
docs/installation/flakes.md
Normal file
@@ -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).*
|
||||
</note>
|
||||
|
||||
## 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; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user