From 9f27b249fb1e01e4eb7566b31fce1c9dafcbd6c1 Mon Sep 17 00:00:00 2001 From: Veneficium <85629831+veneficium42@users.noreply.github.com> Date: Mon, 23 Dec 2024 23:58:50 +0100 Subject: [PATCH] arion: first container: jellyfin! --- containers/jellyfin.nix | 33 ++++++++++++++++++++++++++++ hosts/main-homelab/configuration.nix | 3 +++ 2 files changed, 36 insertions(+) create mode 100644 containers/jellyfin.nix diff --git a/containers/jellyfin.nix b/containers/jellyfin.nix new file mode 100644 index 0000000..3acfc86 --- /dev/null +++ b/containers/jellyfin.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + options.settings.containers.jellyfin = { + enable = lib.mkEnableOption "enable jellyfin arion container"; + }; + + config = lib.mkIf config.settings.containers.jellyfin.enable { + virtualisation.arion.projects.jellyfin = { + settings = { + project.name = "jellyfin"; + services.jellyfin = { + service.useHostStore = true; + nixos.useSystemd = true; + nixos.configuration = + { lib, ... }: + { + boot.isContainer = true; + boot.tmp.useTmpfs = true; + networking.useDHCP = false; + services.nscd.enable = false; + system.nssModules = lib.mkForce [ ]; + }; + service.ports = [ "8096:8096" ]; + }; + }; + }; + }; +} diff --git a/hosts/main-homelab/configuration.nix b/hosts/main-homelab/configuration.nix index 07f004b..d37b5c8 100644 --- a/hosts/main-homelab/configuration.nix +++ b/hosts/main-homelab/configuration.nix @@ -10,6 +10,7 @@ # Include the results of the hardware scan. ./hardware-configuration.nix ../../modules/nixos + ../../containers/jellyfin.nix ]; settings = { @@ -27,6 +28,8 @@ openssh.enable = lib.mkForce true; openssh.usePAM = lib.mkForce true; }; + + containers.jellyfin.enable = true; }; boot.kernelPackages = pkgs.linuxPackages_latest;