Skip to content

upidapi/declarative-arr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Declarative *arr

Caution

This project is no longer maintained. Instead use declarr (also made by me) which is more or less a vastly improved version of this mess.

Nixos modules for the arr suite (currently sonarr, radarr, prowlarr). They all work via sending api requests to mimic a user configuring them. Might change in the future but atm it seams to work quite well.

If you really want the full jellyseerr setup, i also have a module for declarative jellyseerr in my dotfiles. However that one is quite jank. So I dont really recommend it. In the future I might clean it up and publish it.

This project is greatly inspired by declarative-jellyfin, especially this readme.

Warning

This is a young project, so beware of bugs. Backup your existing arr config.

Features

  • Indexers
  • Indexer proxies
  • Download clients
  • Quality
  • Media naming
  • And the glue to bring it all together

The defaults mimic what happens if you just click ok on everything during setup.

I think the options cover most common use cases. If anyone wants them, feel free to contribute, or file an issue. They should be quite simple to add.

Missing features

  • UI Settings
  • Notifications
  • Custom formats
  • "Metadata" tab
  • Metadata sources

Usage

Most options reside under ${serviceName}.guiSettings

Setup

Add the flake to your inputs and import the nixosModule in your configuration.

Example minimal flake.nix:

{
  description = "An example using declarative-arr flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    declarative-jellyfin.url = "github:upidapi/declarative-jellyfin";
    declarative-jellyfin.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = {
    nixpkgs,
    declarative-arr,
    ...
  }: {
    nixosConfigurations."your-hostname" = nixpkgs.lib.nixosSystem {
      modules = [
        declarative-arr.nixosModules.default # <- this imports the NixOS module that provides the options
        ./configuration.nix # <- your host entrypoint
      ];
    };
  };
}

Examples

For a full setup see my dotfiles

Sonarr

services.sonarr = {
  enable = true;
  group = "media";
  # don't do this, you should use a secrets manager like agenix or sops-nix
  apiKeyFile = pkgs.writeText "your api key"; # 32 characters/numbers
  settings = {
    server = {
      port = 8989;
    };
  };
  guiSettings = {
    host = {
      username = "admin";
      # don't do this, you should use a secrets manager like agenix or sops-nix
      password = pkgs.writeText "your secret password"; 
    };

    # Where sonarr stores shows
    rootFolders = ["/media/tv"];

    # Setup connection to your download client
    downloadClients = {
      "qBittorrent" = {
        implementation = "QBittorrent";
        fields = {
          port = ports.qbit;
          host = "127.0.0.1";
          username = "admin";
          # don't do this, you should use a secrets manager like agenix or
          # sops-nix
          password = pkgs.writeText "password to qbittorrent";;
          sequentialOrder = true;
        };
      };
    };
    
    # configure the various quality bitrate, uses the default if not configured
    quality = {
      HDTV-1080p.bitrate = {
        min = 4;
        preferred = 50; # around 2.9GB / h
        max = 100;
      };
      WEBRip-1080p.bitrate = {
        min = 4;
        preferred = 50;
        max = 100;
      };
      WEBDL-1080p.bitrate = {
        min = 4;
        preferred = 50;
        max = 100;
      };
      Bluray-1080p.bitrate = {
        min = 4;
        preferred = 50;
        max = 100;
      };
      # Prevent 100GB 1080p movies
      "Bluray-1080p Remux".bitrate = {
        min = 4;
        preferred = 50;
        max = 150;
      };
    };
  };

About

declarative nixos modules for sonarr, radarr, prowlarr

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages