Skip to content

Commit

Permalink
Renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Feb 21, 2024
1 parent c8ecee1 commit f172e0c
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 73 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
./result
./hugo/public
./hugo/content/index.md
result
hugo/public
hugo/content/index.md
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# servarr.enable
# Nixarr

This is a nixos module that aims to make the installation and management of
running the "*Arrs" as easy, and pain free, as possible.

## Options

The documentation for the options can be found
[here](https://rasmus-kirk.github.io/servarr.enable/)
[here](https://rasmus-kirk.github.io/nixarr/)

## Features

- **Run services through a VPN:** You can run any service that this module
supports through a VPN, fx `servarr.*.useVpn = true;`
supports through a VPN, fx `nixarr.*.useVpn = 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 by default in `/data/.state/servarr/*`
that they manage is 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.

To run services through a VPN, you must provide a wg-quick config file:

```nix
servarr.vpn = {
nixarr.vpn = {
enable = true;
# IMPORTANT: This file must _not_ be in the config git directory
# You can usually get this wireguard file from your VPN provider
Expand All @@ -36,12 +36,12 @@ servarr.vpn = {
Full example can be seen below:

```nix
servarr = {
nixarr = {
enable = true;
# These two values are also the default, but you can set them to whatever
# else you want
mediaDir = "/data/media";
stateDir = "/data/media/.state/servarr";
stateDir = "/data/media/.state/nixarr";
vpn = {
enable = true;
Expand Down Expand Up @@ -87,7 +87,7 @@ Add DDNS-support.

### State Directories

- [ ] Jellyfin: PR is merged, wait for nixpkgs to update
- [ ] Jellyfin: PR is merged, just need to do add it here
- [ ] prowlarr: Works for vpn, probably need to create my own prowlarr systemd service...
- [x] sonarr: Works
- [x] radarr: Works
Expand All @@ -100,7 +100,7 @@ Using buildarr would allow setup services to integrate with each other upon
activation with no user input, definitely nice.

Needs to be added to nixpkgs, not too hard, but is not worth it if the
project is abandoned
project is abandoned.

- [ ] Package with nix
- [ ] Add to nixpkgs
Expand All @@ -112,7 +112,7 @@ idea how this could be done, but would simplify things _a lot_.

### cross-seed

Create a cross-seed service.
Create support for the [cross-seed](https://github.com/cross-seed/cross-seed) service.

- [ ] Package with nix
- [ ] Create nix service daemon
Expand Down
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
description = "The servarr.enable nixos module";
description = "The Nixarr Nixos Module for Hosting the \"*Arrs\"";

nixConfig = {
extra-substituters = ["https://nix-community.cachix.org"];
Expand Down Expand Up @@ -46,8 +46,8 @@

flake = {
nixosModules = rec {
servarr = import ./servarr;
default = servarr;
nixarr = import ./nixarr;
default = nixarr;
};
};

Expand Down
2 changes: 1 addition & 1 deletion mkDocs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
config._module.check = false;
}
#inputs.home-manager.nixosModules.default
./servarr
./nixarr
];
};
optionsDocNixos = nixosOptionsDoc {
Expand Down
32 changes: 17 additions & 15 deletions servarr/default.nix → nixarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
...
}:
with lib; let
cfg = config.servarr;
cfg = config.nixarr;
in {
imports = [
./jellyfin
Expand All @@ -16,13 +16,15 @@ in {
./transmission
];

options.servarr = {
options.nixarr = {
enable = mkEnableOption ''
My servarr setup. Lets you host the servarr services optionally
through a VPN. It is possible, BUT NOT RECOMENDED, to have
prowlarr/sonarr/radarr/readarr/lidarr behind a VPN. Generally, you
should use VPN on transmission and maybe jellyfin, depending on your
setup. Also sets permissions and creates folders.
Primarily, lets you host the "*Arrs" services optionally through a VPN.
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.
- Jellyfin
- Lidarr
Expand Down Expand Up @@ -168,14 +170,14 @@ in {
systemd.tmpfiles.rules = [
# State dirs
"d '${cfg.stateDir}' 0755 root root - -"
"d '${cfg.stateDir}/servarr' 0755 root root - -"
"d '${cfg.stateDir}/servarr/jellyfin' 0700 jellyfin root - -"
"d '${cfg.stateDir}/servarr/transmission' 0700 transmission root - -"
"d '${cfg.stateDir}/servarr/sonarr' 0700 sonarr root - -"
"d '${cfg.stateDir}/servarr/radarr' 0700 radarr root - -"
"d '${cfg.stateDir}/servarr/readarr' 0700 readarr root - -"
"d '${cfg.stateDir}/servarr/lidarr' 0700 lidarr root - -"
"d '${cfg.stateDir}/servarr/prowlarr' 0700 prowlarr root - -"
"d '${cfg.stateDir}/nixarr' 0755 root root - -"
"d '${cfg.stateDir}/nixarr/jellyfin' 0700 jellyfin root - -"
"d '${cfg.stateDir}/nixarr/transmission' 0700 transmission root - -"
"d '${cfg.stateDir}/nixarr/sonarr' 0700 sonarr root - -"
"d '${cfg.stateDir}/nixarr/radarr' 0700 radarr root - -"
"d '${cfg.stateDir}/nixarr/readarr' 0700 readarr root - -"
"d '${cfg.stateDir}/nixarr/lidarr' 0700 lidarr root - -"
"d '${cfg.stateDir}/nixarr/prowlarr' 0700 prowlarr root - -"

# Media dirs
"d '${cfg.mediaDir}' 0775 root media - -"
Expand Down
10 changes: 5 additions & 5 deletions servarr/jellyfin/default.nix → nixarr/jellyfin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
...
}:
with lib; let
cfg = config.servarr.jellyfin;
cfg = config.nixarr.jellyfin;
defaultPort = 8096;
servarr = config.servarr;
nixarr = config.nixarr;
dnsServers = config.lib.vpn.dnsServers;
in {
options.servarr.jellyfin = {
options.nixarr.jellyfin = {
enable = mkOption {
type = types.bool;
default = false;
Expand All @@ -18,7 +18,7 @@ in {

stateDir = mkOption {
type = types.path;
default = "${servarr.stateDir}/servarr/jellyfin";
default = "${nixarr.stateDir}/nixarr/jellyfin";
description = lib.mdDoc "The state directory for jellyfin";
};

Expand Down Expand Up @@ -112,7 +112,7 @@ in {
extraFlags = ["--network-namespace-path=/var/run/netns/wg"];

bindMounts = {
"${servarr.mediaDir}/library".isReadOnly = false;
"${nixarr.mediaDir}/library".isReadOnly = false;
"${cfg.stateDir}".isReadOnly = false;
};

Expand Down
10 changes: 5 additions & 5 deletions servarr/lidarr/default.nix → nixarr/lidarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
...
}:
with lib; let
cfg = config.servarr.lidarr;
cfg = config.nixarr.lidarr;
dnsServers = config.lib.vpn.dnsServers;
servarr = config.servarr;
nixarr = config.nixarr;
in {
options.servarr.lidarr = {
options.nixarr.lidarr = {
enable = mkOption {
type = types.bool;
default = false;
Expand All @@ -17,7 +17,7 @@ in {

stateDir = mkOption {
type = types.path;
default = "${servarr.stateDir}/servarr/lidarr";
default = "${nixarr.stateDir}/nixarr/lidarr";
description = lib.mdDoc "The state directory for lidarr";
};

Expand Down Expand Up @@ -51,7 +51,7 @@ in {
extraFlags = ["--network-namespace-path=/var/run/netns/wg"];

bindMounts = {
"${servarr.mediaDir}".isReadOnly = false;
"${nixarr.mediaDir}".isReadOnly = false;
"${cfg.stateDir}".isReadOnly = false;
};

Expand Down
8 changes: 4 additions & 4 deletions servarr/prowlarr/default.nix → nixarr/prowlarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
with lib; let
defaultPort = 9696;
dnsServers = config.lib.vpn.dnsServers;
servarr = config.servarr;
cfg = config.servarr.prowlarr;
nixarr = config.nixarr;
cfg = config.nixarr.prowlarr;
in {
options.servarr.prowlarr = {
options.nixarr.prowlarr = {
enable = mkOption {
type = types.bool;
default = false;
Expand All @@ -20,7 +20,7 @@ in {

stateDir = mkOption {
type = types.path;
default = "${servarr.stateDir}/servarr/prowlarr";
default = "${nixarr.stateDir}/nixarr/prowlarr";
description = lib.mdDoc ''
The state directory for prowlarr. Currently doesn't work, except with VPN.
'';
Expand Down
10 changes: 5 additions & 5 deletions servarr/radarr/default.nix → nixarr/radarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
...
}:
with lib; let
cfg = config.servarr.radarr;
cfg = config.nixarr.radarr;
defaultPort = 7878;
servarr = config.servarr;
nixarr = config.nixarr;
dnsServers = config.lib.vpn.dnsServers;
in {
options.servarr.radarr = {
options.nixarr.radarr = {
enable = mkOption {
type = types.bool;
default = false;
Expand All @@ -20,7 +20,7 @@ in {

stateDir = mkOption {
type = types.path;
default = "${servarr.stateDir}/servarr/radarr";
default = "${nixarr.stateDir}/nixarr/radarr";
description = lib.mdDoc "The state directory for radarr";
};

Expand Down Expand Up @@ -54,7 +54,7 @@ in {
extraFlags = ["--network-namespace-path=/var/run/netns/wg"];

bindMounts = {
"${servarr.mediaDir}".isReadOnly = false;
"${nixarr.mediaDir}".isReadOnly = false;
"${cfg.stateDir}".isReadOnly = false;
};

Expand Down
10 changes: 5 additions & 5 deletions servarr/readarr/default.nix → nixarr/readarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
...
}:
with lib; let
cfg = config.servarr.readarr;
servarr = config.servarr;
cfg = config.nixarr.readarr;
nixarr = config.nixarr;
dnsServers = config.lib.vpn.dnsServers;
in {
options.servarr.readarr = {
options.nixarr.readarr = {
enable = mkOption {
type = types.bool;
default = false;
Expand All @@ -17,7 +17,7 @@ in {

stateDir = mkOption {
type = types.path;
default = "${servarr.stateDir}/servarr/readarr";
default = "${nixarr.stateDir}/nixarr/readarr";
description = lib.mdDoc "The state directory for readarr";
};

Expand Down Expand Up @@ -51,7 +51,7 @@ in {
extraFlags = ["--network-namespace-path=/var/run/netns/wg"];

bindMounts = {
"${servarr.mediaDir}".isReadOnly = false;
"${nixarr.mediaDir}".isReadOnly = false;
"${cfg.stateDir}".isReadOnly = false;
};

Expand Down
10 changes: 5 additions & 5 deletions servarr/sonarr/default.nix → nixarr/sonarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
...
}:
with lib; let
cfg = config.servarr.sonarr;
cfg = config.nixarr.sonarr;
defaultPort = 8989;
servarr = config.servarr;
nixarr = config.nixarr;
dnsServers = config.lib.vpn.dnsServers;
in {
options.servarr.sonarr = {
options.nixarr.sonarr = {
enable = mkOption {
type = types.bool;
default = false;
Expand All @@ -19,7 +19,7 @@ in {

stateDir = mkOption {
type = types.path;
default = "${servarr.stateDir}/sonarr";
default = "${nixarr.stateDir}/sonarr";
description = lib.mdDoc "The state directory for sonarr";
};

Expand Down Expand Up @@ -51,7 +51,7 @@ in {
extraFlags = ["--network-namespace-path=/var/run/netns/wg"];

bindMounts = {
"${servarr.mediaDir}".isReadOnly = false;
"${nixarr.mediaDir}".isReadOnly = false;
"${cfg.stateDir}".isReadOnly = false;
};

Expand Down
Loading

0 comments on commit f172e0c

Please sign in to comment.