From 49ecab9603ad85abdd4fccb5dbb5b1a5c180d0a8 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Thu, 19 Dec 2024 21:32:21 +0100 Subject: [PATCH] Run Jellyseerr in NixNG container --- README.md | 2 +- flake.lock | 23 ++++++++++++++++++++--- flake.nix | 1 + modules/media.nix | 3 ++- nixng-configurations/default.nix | 7 ++++++- nixng-configurations/jellyseerr.nix | 14 ++++++++++++++ 6 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 nixng-configurations/jellyseerr.nix diff --git a/README.md b/README.md index cbfe29a..55114f9 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ Legend: | ✨ | `nixng-attic` | | | ✨ | `nixng-ntfy-sh` | | | ✨ | `nixng-radicale` | | +| ✨ | `nixng-jellyseerr` | | | ✅ | `jellyfin/jellyfin` | | | ✅ | `linuxserver/deluge` | | -| ✅ | `fallenbagel/jellyseerr` | | | ✅ | `lscr.io/linuxserver/radarr` | | | ✅ | `lscr.io/linuxserver/prowlarr` | | | ✅ | `lscr.io/linuxserver/sonarr` | | diff --git a/flake.lock b/flake.lock index 467fda2..8f0348c 100644 --- a/flake.lock +++ b/flake.lock @@ -676,11 +676,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1734638453, - "narHash": "sha256-eZfU3yMDpRFJ2ZZUXDyOxTQCZ6DgnbpmMmsFjqAhSW8=", + "lastModified": 1734639946, + "narHash": "sha256-IEuuBrDBGndTnKLfZJ9e8jBvHmIUsUAaTizgn1jmPDs=", "owner": "pizzapim", "repo": "NixNG", - "rev": "59039fdc19c743035f3c1bd0f6b5968484c04e19", + "rev": "a9fa516abbe137c7abbce564150e7e84c701ef05", "type": "github" }, "original": { @@ -759,6 +759,22 @@ "type": "github" } }, + "nixpkgs-jellyseerr": { + "locked": { + "lastModified": 1734541836, + "narHash": "sha256-7t3dVNT54Zef2smJb+SElmMlhPsgfyRuFMIFZXe2mEo=", + "owner": "coonce", + "repo": "nixpkgs", + "rev": "d4e5e684f7edbae6f814ab16e05a82fd25c63cda", + "type": "github" + }, + "original": { + "owner": "coonce", + "ref": "jellyseerr", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1730741070, @@ -923,6 +939,7 @@ "nixhelm": "nixhelm", "nixng": "nixng", "nixpkgs": "nixpkgs_2", + "nixpkgs-jellyseerr": "nixpkgs-jellyseerr", "servers": "servers", "treefmt-nix": "treefmt-nix_4" } diff --git a/flake.nix b/flake.nix index 9b3adf0..2150e62 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; treefmt-nix.url = "github:numtide/treefmt-nix"; + nixpkgs-jellyseerr.url = "github:coonce/nixpkgs?ref=jellyseerr"; git-hooks = { url = "github:cachix/git-hooks.nix"; diff --git a/modules/media.nix b/modules/media.nix index 3ed17d3..1732d82 100644 --- a/modules/media.nix +++ b/modules/media.nix @@ -2,6 +2,7 @@ globals, config, lib, + utils, ... }: { options.media.enable = lib.mkEnableOption "media"; @@ -167,7 +168,7 @@ volumes.config.persistentVolumeClaim.claimName = "jellyseerr"; containers.jellyseerr = { - image = globals.images.jellyseerr; + image = utils.mkNixNGImage "jellyseerr"; ports.web.containerPort = 5055; imagePullPolicy = "IfNotPresent"; diff --git a/nixng-configurations/default.nix b/nixng-configurations/default.nix index 5c97bae..a756fcc 100644 --- a/nixng-configurations/default.nix +++ b/nixng-configurations/default.nix @@ -3,6 +3,7 @@ flake-utils, nixng, nixpkgs, + nixpkgs-jellyseerr, ... }: flake-utils.lib.eachDefaultSystem (system: let @@ -11,13 +12,17 @@ flake-utils.lib.eachDefaultSystem (system: let attic = ./attic.nix; ntfy = ./ntfy.nix; radicale = ./radicale.nix; + jellyseerr = ./jellyseerr.nix; }; in { nixngConfigurations = builtins.mapAttrs (name: configFile: nixng.nglib.makeSystem { inherit nixpkgs system; name = "nixng-${name}"; - specialArgs = {inherit (self) globals;}; + specialArgs = { + inherit nixpkgs-jellyseerr; + inherit (self) globals; + }; config = import configFile; }) images; diff --git a/nixng-configurations/jellyseerr.nix b/nixng-configurations/jellyseerr.nix new file mode 100644 index 0000000..4639caa --- /dev/null +++ b/nixng-configurations/jellyseerr.nix @@ -0,0 +1,14 @@ +{ + system, + nixpkgs-jellyseerr, + ... +}: { + dinit.enable = true; + init.services.jellyseerr.shutdownOnExit = true; + + services.jellyseerr = { + enable = true; + package = nixpkgs-jellyseerr.legacyPackages.${system}.jellyseerr; + configDir = "/app/config"; + }; +}