more organization, or maybe disorganization...

This commit is contained in:
mjallen18
2024-02-25 18:21:21 -06:00
parent f0e5baea4b
commit cd4a68b513
30 changed files with 560 additions and 447 deletions

View File

@@ -0,0 +1,25 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nas-apps.collabora;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.port}:9980" ];
volumes = [
# ...
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -0,0 +1,43 @@
{ lib, ... }:
with lib;
{
options.nas-apps.collabora = {
enable = mkEnableOption "collabora docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "9980";
};
name = mkOption {
type = types.str;
default = "collabora";
};
image = mkOption {
type = types.str;
default = "collabora/code";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}

View File

@@ -0,0 +1,17 @@
{ config, pkgs, ... }:
{
# dashy
virtualisation.oci-containers.containers."dashy" = {
autoStart = true;
image = " lissy93/dashy:latest";
ports = [ "8888:80" ];
volumes = [
"/mnt/ssd/nix-app-data/dashy/conf.yaml:/app/public/conf.yaml"
];
environment = {
PUID = "911";
PGID = "1000";
TZ = "America/Chicago";
};
};
}

View File

@@ -0,0 +1,77 @@
{ lib, pkgs, config, ... }:
with lib;
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 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" ];
};
};
}
# { config, pkgs, ... }:
# {
# # Jellyfin
# # Nix
# # environment.systemPackages = [
# # pkgs.jellyfin
# # pkgs.jellyfin-web
# # pkgs.jellyfin-ffmpeg
# # ];
# # services.jellyfin = {
# # enable = true;
# # user = "911";
# # group = "1000";
# # # dataDir = "/mnt/Safe\ SSD/ssd_app_data/jellyfin/config"; # defaults to /var/lib/jellyfin and cannot be changed....
# # openFirewall = true;
# # };
# # nix-docker
# # virtualisation.oci-containers.containers."jellyfin" = {
# # autoStart = true;
# # image = "linuxserver/jellyfin";
# # cmd = [ "--gpus all" ];
# # 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 = {
# # NVIDIA_VISIBLE_DEVICES = "all";
# # NVIDIA_DRIVER_CAPABILITIES = "compute,utility";
# # JELLYFIN_LOG_DIR = "/log";
# # PUID = "911";
# # PGID = "1000";
# # };
# # };
# }

View File

@@ -0,0 +1,58 @@
{ lib, ... }:
with lib;
{
options.nas-apps.jellyfin = {
enable = mkEnableOption "jellyfin docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "8096";
};
name = mkOption {
type = types.str;
default = "jellyfin";
};
image = mkOption {
type = types.str;
default = "lscr.io/linuxserver/jellyfin";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/nix-app-data/jellyfin";
};
moviesPath = mkOption {
type = types.str;
default = "/mnt/mainpool/Movies";
};
tvPath = mkOption {
type = types.str;
default = "/mnt/mainpool/Tv";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}

View File

@@ -0,0 +1,25 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nas-apps.jellyseerr;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.port}:5055" ];
volumes = [
"${cfg.configPath}:/config"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -0,0 +1,48 @@
{ lib, ... }:
with lib;
{
options.nas-apps.jellyseerr = {
enable = mkEnableOption "jellyseerr docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "5055";
};
name = mkOption {
type = types.str;
default = "jellyseerr";
};
image = mkOption {
type = types.str;
default = "fallenbagel/jellyseerr";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/jellyseerr";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}

View File

@@ -0,0 +1,29 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nas-apps.mariadb;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.port}:3306" ];
volumes = [
"${cfg.configPath}:/config"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
MYSQL_ROOT_PASSWORD = cfg.rootPassword;
MYSQL_DATABASE = cfg.databaseName;
MYSQL_USER = cfg.databaseUser;
MYSQL_PASSWORD = cfg.databasePassword;
};
};
};
}

View File

@@ -0,0 +1,67 @@
{ lib, ... }:
with lib;
{
options.nas-apps.mariadb = {
enable = mkEnableOption "mariadb docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "3306";
};
name = mkOption {
type = types.str;
default = "mariadb";
};
image = mkOption {
type = types.str;
default = "linuxserver/mariadb";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/mariadb";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
rootPassword = mkOption {
type = types.str;
default = "BogieDudie1";
};
databaseName = mkOption {
type = types.str;
default = "jallen_nextcloud";
};
databaseUser = mkOption {
type = types.str;
default = "nextcloud";
};
databasePassword = mkOption {
type = types.str;
default = "BogieDudie1";
};
};
}

View File

@@ -0,0 +1,26 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nas-apps.nextcloud;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.httpPort}:80" "${cfg.httpsPort}:443" ];
volumes = [
"${cfg.configPath}:/config"
"${cfg.dataPath}:/data"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -0,0 +1,57 @@
{ lib, ... }:
with lib;
{
options.nas-apps.nextcloud = {
enable = mkEnableOption "nextcloud docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
httpPort = mkOption {
type = types.str;
default = "80";
};
httpsPort = mkOption {
type = types.str;
default = "443";
};
name = mkOption {
type = types.str;
default = "nextcloud";
};
image = mkOption {
type = types.str;
default = "linuxserver/nextcloud";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/nextcloud";
};
dataPath = mkOption {
type = types.str;
default = "/mnt/mainpool/Nextcloud";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}

View File

@@ -0,0 +1,27 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nas-apps.radarr;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.port}:7878" ];
volumes = [
"${cfg.configPath}:/config"
"${cfg.moviesPath}:/movies"
"${cfg.downloadsPath}:/downloads"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -0,0 +1,57 @@
{ lib, ... }:
with lib;
{
options.nas-apps.radarr = {
enable = mkEnableOption "radarr docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "7878";
};
name = mkOption {
type = types.str;
default = "radarr";
};
image = mkOption {
type = types.str;
default = "linuxserver/radarr";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/radarr";
};
moviesPath = mkOption {
type = types.str;
default = "/mnt/mainpool/Movies";
};
downloadsPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/downloads";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}

View File

@@ -0,0 +1,29 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nas-apps.sabnzbd;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.port}:8080" ];
volumes = [
"${cfg.configPath}:/config"
"${cfg.moviesPath}:/movies"
"${cfg.tvPath}:/tv"
"${cfg.downloadsPath}:/downloads"
"${cfg.downloadsIncompletePath}:/downloads-incomplete"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -0,0 +1,68 @@
{ lib, ... }:
with lib;
{
options.nas-apps.sabnzbd = {
enable = mkEnableOption "sabnzbd docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "8080";
};
name = mkOption {
type = types.str;
default = "sabnzbd";
};
image = mkOption {
type = types.str;
default = "linuxserver/sabnzbd";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/sabnzbd";
};
moviesPath = mkOption {
type = types.str;
default = "/mnt/mainpool/Movies";
};
tvPath = mkOption {
type = types.str;
default = "/mnt/mainpool/Tv";
};
downloadsPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/downloads";
};
downloadsIncompletePath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/downloads-incomplete";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}

View File

@@ -0,0 +1,27 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nas-apps.sonarr;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${cfg.port}:8989" ];
volumes = [
"${cfg.configPath}:/config"
"${cfg.tvPath}:/tv"
"${cfg.downloadsPath}:/downloads"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
};
};
};
}

View File

@@ -0,0 +1,57 @@
{lib, ... }:
with lib;
{
options.nas-apps.sonarr = {
enable = mkEnableOption "sonarr docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
port = mkOption {
type = types.str;
default = "8989";
};
name = mkOption {
type = types.str;
default = "sonarr";
};
image = mkOption {
type = types.str;
default = "linuxserver/sonarr";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/sonarr";
};
tvPath = mkOption {
type = types.str;
default = "/mnt/mainpool/TV";
};
downloadsPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/downloads";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
};
}

View File

@@ -0,0 +1,35 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.nas-apps.swag;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
networking.firewall = {
allowedTCPPorts = [ cfg.httpPort cfg.httpsPort ];
allowedUDPPorts = [ cfg.httpPort cfg.httpsPort ];
};
virtualisation.oci-containers.containers."${cfg.name}" = {
autoStart = cfg.autoStart;
image = cfg.image;
ports = [ "${toString cfg.httpPort}:80" "${toString cfg.httpsPort}:443" ];
volumes = [
"${cfg.configPath}:/config"
];
environment = {
PUID = cfg.puid;
PGID = cfg.pgid;
TZ = cfg.timeZone;
EMAIL = cfg.email;
URL = cfg.url;
VALIDATION = cfg.validation;
SUBDOMAINS = cfg.subdomains;
};
};
};
}

View File

@@ -0,0 +1,72 @@
{lib, ... }:
with lib;
{
options.nas-apps.swag = {
enable = mkEnableOption "swag docker service";
autoStart = mkOption {
type = types.bool;
default = true;
};
httpPort = mkOption {
type = types.int;
default = 80;
};
httpsPort = mkOption {
type = types.int;
default = 443;
};
name = mkOption {
type = types.str;
default = "swag";
};
image = mkOption {
type = types.str;
default = "linuxserver/swag";
};
configPath = mkOption {
type = types.str;
default = "/mnt/ssd/ssd_app_data/swag";
};
puid = mkOption {
type = types.str;
default = "911";
};
pgid = mkOption {
type = types.str;
default = "1000";
};
timeZone = mkOption {
type = types.str;
default = "America/Chicago";
};
email = mkOption {
type = types.str;
default = "jalle008@proton.me";
};
url = mkOption {
type = types.str;
default = "mjallen.dev";
};
validation = mkOption {
type = types.str;
default = "http";
};
subdomains = mkOption {
type = types.str;
default = "jellyfin,hass,cloud,office,jellyseerr";
};
};
}