From 62a3630a5ce76d3c9e3465fe3657646518e32915 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 7 Oct 2024 09:35:22 +0100 Subject: [PATCH] modify jellyfin & nix-bitcoin containers --- .../common/optional/nixos-containers/jellyfin.nix | 14 ++++++++++++-- .../optional/nixos-containers/nix-bitcoin.nix | 2 +- .../common/optional/nixos-containers/postgres.nix | 2 +- hosts/semita/default.nix | 5 ++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/hosts/common/optional/nixos-containers/jellyfin.nix b/hosts/common/optional/nixos-containers/jellyfin.nix index 5fd75fb..c9c2470 100644 --- a/hosts/common/optional/nixos-containers/jellyfin.nix +++ b/hosts/common/optional/nixos-containers/jellyfin.nix @@ -18,11 +18,21 @@ in { networking.nat.internalInterfaces = ["ve-+"]; networking.nat.externalInterface = "br0"; - containers.postgres = { + containers.${container_name} = { autoStart = true; privateNetwork = true; hostBridge = "br0"; nixpkgs = pkgs.path; + bindMounts = { + "/var/lib/jellyfin" = { + hostPath = "/media/main-ssd/jellyfin"; + isReadOnly = false; + }; + "/var/lib/jellyfin/data/media" = { + hostPath = "/media/media"; + isReadOnly = true; + }; + }; config = { pkgs, @@ -51,13 +61,13 @@ in { services.jellyfin = { enable = true; openFirewall = true; + user="jellyfin"; }; environment.systemPackages = [ pkgs.jellyfin pkgs.jellyfin-web pkgs.jellyfin-ffmpeg - pkgs.lsof ]; services.openssh = { diff --git a/hosts/common/optional/nixos-containers/nix-bitcoin.nix b/hosts/common/optional/nixos-containers/nix-bitcoin.nix index 81a71f8..fb1242a 100644 --- a/hosts/common/optional/nixos-containers/nix-bitcoin.nix +++ b/hosts/common/optional/nixos-containers/nix-bitcoin.nix @@ -10,7 +10,7 @@ bitcoin-HMAC-privileged = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."software/bitcoind/bitcoin-HMAC-privileged".path; bitcoin-HMAC-public = lib.optionalString (lib.hasAttr "sops-nix" inputs) config.sops.secrets."software/bitcoind/bitcoin-HMAC-public".path; container_name = "bitcoin-node"; - container_ip = "10.0.10.5"; + container_ip = "10.0.10.4"; pubKeys = lib.filesystem.listFilesRecursive ../../users/keys; in { sops.secrets = { diff --git a/hosts/common/optional/nixos-containers/postgres.nix b/hosts/common/optional/nixos-containers/postgres.nix index 2082dbb..d53c182 100644 --- a/hosts/common/optional/nixos-containers/postgres.nix +++ b/hosts/common/optional/nixos-containers/postgres.nix @@ -26,7 +26,7 @@ in { networking.nat.internalInterfaces = ["ve-+"]; networking.nat.externalInterface = "br0"; - containers.postgres = { + containers.${container_name} = { autoStart = true; privateNetwork = true; hostBridge = "br0"; diff --git a/hosts/semita/default.nix b/hosts/semita/default.nix index 321fea6..aa1da1e 100644 --- a/hosts/semita/default.nix +++ b/hosts/semita/default.nix @@ -49,6 +49,7 @@ in { ../common/optional/docker ../common/optional/nixos-containers/nix-bitcoin.nix ../common/optional/nixos-containers/postgres.nix + ../common/optional/nixos-containers/jellyfin.nix ]; fileSystems."/media/main-ssd" = { @@ -85,6 +86,7 @@ in { pkgs.sof-firmware ]; + # Add hardware support for intel gpus as specified here: https://nixos.wiki/wiki/Jellyfin nixpkgs.config.packageOverrides = pkgs: { vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;}; }; @@ -97,7 +99,8 @@ in { vaapiVdpau libvdpau-va-gl intel-compute-runtime - vpl-gpu-rt + # only available on unstable + unstable.vpl-gpu-rt intel-media-sdk ]; };