formatting
This commit is contained in:
@@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{ lib, ... }:
|
||||
with lib; {
|
||||
with lib;
|
||||
{
|
||||
options.nas-apps.jellyfin = {
|
||||
enable = mkEnableOption "jellyfin docker service";
|
||||
|
||||
@@ -52,6 +53,5 @@ with lib; {
|
||||
type = types.str;
|
||||
default = "America/Chicago";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user