formatting

This commit is contained in:
mjallen18
2024-05-31 16:11:42 -05:00
parent 4aead74c7f
commit 29ec754b2f
82 changed files with 1521 additions and 974 deletions

View File

@@ -1,54 +1,35 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
with lib;
let cfg = config.nas-apps.jellyfin;
in {
let
cfg = config.nas-apps.jellyfin;
in
{
imports = [ ./options.nix ];
config = mkIf cfg.enable {
# systemd.services.jellyfin-nvidia-docker = {
# path = [ pkgs.bash pkgs.docker ];
# script = ''
# set -e
# exec sudo docker run \
# --rm \
# --gpus all \
# --runtime=nvidia \
# --name=${cfg.name} \
# -e PUID=${cfg.puid} \
# -e PGID=${cfg.pgid} \
# -e TZ=${cfg.timeZone} \
# -e 'NVIDIA_DRIVER_CAPABILITIES'='all' \
# -e 'NVIDIA_VISIBLE_DEVICES'='all' \
# -p ${cfg.port}:8096 \
# -v '${cfg.configPath}:/config' \
# -v '${cfg.moviesPath}:/data/movies' \
# -v '${cfg.tvPath}:/data/tv' \
# ${cfg.image}:latest
# '';
# wantedBy = [ "multi-user.target" ];
# };
# };
# }
# nix-docker
virtualisation.oci-containers.containers.${cfg.name} = {
autoStart = true;
image = cfg.image;
extraOptions = [ "--device=nvidia.com/gpu=0" ];
volumes = [
"${cfg.configPath}:/config"
"${cfg.moviesPath}:/data/movies"
"${cfg.tvPath}:/data/tv"
];
ports = [ "${cfg.port}:8096" ];
environment = {
NVIDIA_VISIBLE_DEVICES = "all";
NVIDIA_DRIVER_CAPABILITIES = "all";
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
virtualisation.oci-containers.containers.${cfg.name} = {
autoStart = true;
image = cfg.image;
extraOptions = [ "--device=nvidia.com/gpu=0" ];
volumes = [
"${cfg.configPath}:/config"
"${cfg.moviesPath}:/data/movies"
"${cfg.tvPath}:/data/tv"
];
ports = [ "${cfg.port}:8096" ];
environment = {
NVIDIA_VISIBLE_DEVICES = "all";
NVIDIA_DRIVER_CAPABILITIES = "all";
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
};
}