Skip to main content

Nix Package Manager (Advanced)

info

This method is not recommended for most users. It is intended for advanced users who are using Nix as their package manager.

warning
The upstream Jellyseerr Nix Package (vLoading...) is not up-to-date. If you want to use Jellyseerr v0.0.0, you will need to override the package derivation.

Installation

To get up and running with jellyseerr using Nix, you can add the following to your configuration.nix:

{ config, pkgs, ... }:

{
services.jellyseerr.enable = true;
}

If you want more advanced configuration options, you can use the following:

{ config, pkgs, ... }:

{
services.jellyseerr = {
enable = true;
port = 5055;
openFirewall = true;
};
}

After adding the configuration to your configuration.nix, you can run the following command to install jellyseerr:

nixos-rebuild switch

After rebuild is complete jellyseerr should be running, verify that it is with the following command.

systemctl status jellyseerr
info

You can now access Jellyseerr by visiting http://localhost:5055 in your web browser.

Overriding the package derivation

The latest version of Jellyseerr (0.0.0) and the Jellyseerr nixpkg version (vLoading...) is out-of-date. If you want to use Jellyseerr v0.0.0, you will need to override the package derivation.

In order to override the package derivation:

  1. Grab the latest nixpkg derivation for Jellyseerr
  2. Grab the latest package.json for Jellyseerr
  3. Add it to the same directory as the nixpkg derivation
  4. Update the `src` and `offlineCache` attributes in the nixpkg derivation:
  5. { config, pkgs, ... }:
    {
    nixpkgs.config.packageOverrides = pkgs: {
    jellyseerr = pkgs.jellyseerr.overrideAttrs (oldAttrs: rec {
    version = "0.0.0";

    src = pkgs.fetchFromGitHub {
    rev = "v${version}";
    sha256 = pkgs.lib.fakeSha256;
    };

    offlineCache = pkgs.fetchYarnDeps {
    sha256 = pkgs.lib.fakeSha256;
    };
    });
    };
    }
    tip
    You can replace the sha256 with the actual hash that nixos-rebuild outputs when you run the command.
  6. Grab this module and import it in your `configuration.nix`
  7. { config, pkgs, lib, ... }:

    with lib;
    let
    cfg = config.services.jellyseerr;
    in
    {
    meta.maintainers = [ maintainers.camillemndn ];

    disabledModules = [ "services/misc/jellyseerr.nix" ];

    options.services.jellyseerr = {
    enable = mkEnableOption (mdDoc ''Jellyseerr, a requests manager for Jellyfin'');

    openFirewall = mkOption {
    type = types.bool;
    default = false;
    description = mdDoc ''Open port in the firewall for the Jellyseerr web interface.'';
    };

    port = mkOption {
    type = types.port;
    default = 5055;
    description = mdDoc ''The port which the Jellyseerr web UI should listen to.'';
    };

    package = mkOption {
    type = types.package;
    default = pkgs.jellyseerr;
    defaultText = literalExpression "pkgs.jellyseerr";
    description = lib.mdDoc ''
    Jellyseerr package to use.
    '';
    };
    };

    config = mkIf cfg.enable {
    systemd.services.jellyseerr = {
    description = "Jellyseerr, a requests manager for Jellyfin";
    after = [ "network.target" ];
    wantedBy = [ "multi-user.target" ];
    environment.PORT = toString cfg.port;
    serviceConfig = {
    Type = "exec";
    StateDirectory = "jellyseerr";
    WorkingDirectory = "${cfg.package}/libexec/jellyseerr/deps/jellyseerr";
    DynamicUser = true;
    ExecStart = "${cfg.package}/bin/jellyseerr";
    BindPaths = [ "/var/lib/jellyseerr/:${cfg.package}/libexec/jellyseerr/deps/jellyseerr/config/" ];
    Restart = "on-failure";
    ProtectHome = true;
    ProtectSystem = "strict";
    PrivateTmp = true;
    PrivateDevices = true;
    ProtectHostname = true;
    ProtectClock = true;
    ProtectKernelTunables = true;
    ProtectKernelModules = true;
    ProtectKernelLogs = true;
    ProtectControlGroups = true;
    NoNewPrivileges = true;
    RestrictRealtime = true;
    RestrictSUIDSGID = true;
    RemoveIPC = true;
    PrivateMounts = true;
    };
    };

    networking.firewall = mkIf cfg.openFirewall {
    allowedTCPPorts = [ cfg.port ];
    };
    };
    }
    tip
    We are using a custom module because the upstream module does not have a package option.
  8. Call the new package in your `configuration.nix`
  9. { config, pkgs, ... }:
    {
    imports = [ ./jellyseerr-module.nix ]

    services.jellyseerr = {
    enable = true;
    port = 5055;
    openFirewall = true;
    package = (pkgs.callPackage (import ../../../pkgs/jellyseerr) { });
    };
    }