From 9c088f2f438658fe64d60efe0cddd8d63265ebb9 Mon Sep 17 00:00:00 2001 From: mjallen18 Date: Sun, 18 Feb 2024 18:14:32 -0600 Subject: [PATCH] jellyfin to docker --- configuration-nas.nix | 5 ++++- nas-apps/jellyfin.nix | 36 ++++++++++++++++++++++++++++-------- nas-apps/swag.nix | 20 ++++++++++++++++++++ 3 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 nas-apps/swag.nix diff --git a/configuration-nas.nix b/configuration-nas.nix index 5bd3449..44aa78f 100644 --- a/configuration-nas.nix +++ b/configuration-nas.nix @@ -13,8 +13,9 @@ in { imports = [ # Include the results of the hardware scan. - ./hardware-configuration.nix + ./hardware-configuration-nas.nix ./nas-apps/jellyfin.nix + ./nas-apps/swag.nix ]; # Enable nix flakes and nix-command tools @@ -211,6 +212,8 @@ in ]; }; + virtualisation.docker.enable = true; + # This option defines the first version of NixOS you have installed on this particular machine, # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. # diff --git a/nas-apps/jellyfin.nix b/nas-apps/jellyfin.nix index a537a6d..dd4d30c 100644 --- a/nas-apps/jellyfin.nix +++ b/nas-apps/jellyfin.nix @@ -1,14 +1,34 @@ { config, pkgs, ... }: { - environment.systemPackages = [ - pkgs.jellyfin - pkgs.jellyfin-web - pkgs.jellyfin-ffmpeg - ]; + # environment.systemPackages = [ + # pkgs.jellyfin + # pkgs.jellyfin-web + # pkgs.jellyfin-ffmpeg + # ]; - services.jellyfin = { - enable = true; - openFirewall = true; + # services.jellyfin = { + # enable = true; + # openFirewall = true; + # }; + + + # Jellyfin + virtualisation.oci-containers.containers."jellyfin" = { + autoStart = true; + image = "jellyfin/jellyfin"; + volumes = [ + "/mnt/Safe\ SSD/ssd_app_data/jellyfin/config:/config" + "/mnt/Safe\ SSD/ssd_app_data/jellyfin/cache:/cache" + "/mnt/Safe\ SSD/ssd_app_data/jellyfin/log:/log" + "/mnt/Main\ Pool/Movies:/movies" + "/mnt/Main\ Pool/tv:/TV" + ]; + ports = [ "8096:8096" ]; + environment = { + JELLYFIN_LOG_DIR = "/log"; + PUID = 911; + PGID = 1000; }; + }; } \ No newline at end of file diff --git a/nas-apps/swag.nix b/nas-apps/swag.nix new file mode 100644 index 0000000..e7b8181 --- /dev/null +++ b/nas-apps/swag.nix @@ -0,0 +1,20 @@ +{ config, pkgs, ... }: +{ + # Swag + virtualisation.oci-containers.containers."portainer" = { + autoStart = true; + image = "linuxserver/swag"; + ports = [ "80:80" "443:443" ]; + volumes = [ + "/mnt/Safe\ SSD/ssd_app_data/swag:/config" + ]; + environment = { + PGID = 1000; + PUID = 1000; + TZ = "America/Chicago"; + URL = "mjallen.dev"; + VALIDATION = "http"; + SUBDOMAINS = "jellyfin,hass,cloud,jellyseer"; + }; + }; +}