--- title: Nix Package Manager (Advanced) description: Install Jellyseerr using Nix sidebar_position: 3 --- import { JellyseerrVersion, NixpkgVersion } from '@site/src/components/JellyseerrVersion'; import Admonition from '@theme/Admonition'; # 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. ::: export const VersionMismatchWarning = () => { const jellyseerrVersion = JellyseerrVersion(); const nixpkgVersion = NixpkgVersion(); const isUpToDate = jellyseerrVersion === nixpkgVersion; return ( <> {!isUpToDate ? ( The upstream Jellyseerr Nix Package (v{nixpkgVersion}) is not up-to-date. If you want to use Jellyseerr v{jellyseerrVersion}, you will need to override the package derivation. ) : ( The upstream Jellyseerr Nix Package (v{nixpkgVersion}) is up-to-date with Jellyseerr v{jellyseerrVersion}. )} ); }; ## Installation To get up and running with jellyseerr using Nix, you can add the following to your `configuration.nix`: ```nix { config, pkgs, ... }: { services.jellyseerr.enable = true; } ``` If you want more advanced configuration options, you can use the following: ```nix { 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: ```bash nixos-rebuild switch ``` After rebuild is complete jellyseerr should be running, verify that it is with the following command. ```bash systemctl status jellyseerr ``` :::info You can now access Jellyseerr by visiting `http://localhost:5055` in your web browser. ::: import CodeBlock from '@theme/CodeBlock'; ## Overriding the package derivation export const VersionMatch = () => { const jellyseerrVersion = JellyseerrVersion(); const nixpkgVersion = NixpkgVersion(); const code = `{ config, pkgs, ... }: { nixpkgs.config.packageOverrides = pkgs: { jellyseerr = pkgs.jellyseerr.overrideAttrs (oldAttrs: rec { version = "${jellyseerrVersion}"; src = pkgs.fetchFromGitHub { rev = "v\${version}"; sha256 = pkgs.lib.fakeSha256; }; offlineCache = pkgs.fetchYarnDeps { sha256 = pkgs.lib.fakeSha256; }; }); }; }`; const module = `{ 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 ]; }; }; }`; const configuration = `{ config, pkgs, ... }: { imports = [ ./jellyseerr-module.nix ] services.jellyseerr = { enable = true; port = 5055; openFirewall = true; package = (pkgs.callPackage (import ../../../pkgs/jellyseerr) { }); }; }`; const isUpToDate = jellyseerrVersion === nixpkgVersion; return ( <> {isUpToDate ? ( <>

The latest version of Jellyseerr ({jellyseerrVersion}) and the Jellyseerr nixpkg package version ({nixpkgVersion}) is up-to-date.

There is no need to override the package derivation.

) : ( <>

The latest version of Jellyseerr ({jellyseerrVersion}) and the Jellyseerr nixpkg version (v{nixpkgVersion}) is out-of-date. If you want to use Jellyseerr v{jellyseerrVersion}, 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. {code} 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. {module} 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. {configuration}
)} ); };