more organization, or maybe disorganization...
This commit is contained in:
25
modules/apps/collabora/default.nix
Normal file
25
modules/apps/collabora/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
43
modules/apps/collabora/options.nix
Normal file
43
modules/apps/collabora/options.nix
Normal 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";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
17
modules/apps/dashy/default.nix
Normal file
17
modules/apps/dashy/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
77
modules/apps/jellyfin/default.nix
Normal file
77
modules/apps/jellyfin/default.nix
Normal 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";
|
||||
# # };
|
||||
# # };
|
||||
# }
|
||||
58
modules/apps/jellyfin/options.nix
Normal file
58
modules/apps/jellyfin/options.nix
Normal 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";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
25
modules/apps/jellyseerr/default.nix
Normal file
25
modules/apps/jellyseerr/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
48
modules/apps/jellyseerr/options.nix
Normal file
48
modules/apps/jellyseerr/options.nix
Normal 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";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
29
modules/apps/mariadb/default.nix
Normal file
29
modules/apps/mariadb/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
67
modules/apps/mariadb/options.nix
Normal file
67
modules/apps/mariadb/options.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/apps/nextcloud/default.nix
Normal file
26
modules/apps/nextcloud/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
57
modules/apps/nextcloud/options.nix
Normal file
57
modules/apps/nextcloud/options.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
27
modules/apps/radarr/default.nix
Normal file
27
modules/apps/radarr/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
57
modules/apps/radarr/options.nix
Normal file
57
modules/apps/radarr/options.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
29
modules/apps/sabnzbd/default.nix
Normal file
29
modules/apps/sabnzbd/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
68
modules/apps/sabnzbd/options.nix
Normal file
68
modules/apps/sabnzbd/options.nix
Normal 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";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
27
modules/apps/sonarr/default.nix
Normal file
27
modules/apps/sonarr/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
57
modules/apps/sonarr/options.nix
Normal file
57
modules/apps/sonarr/options.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
35
modules/apps/swag/default.nix
Normal file
35
modules/apps/swag/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
72
modules/apps/swag/options.nix
Normal file
72
modules/apps/swag/options.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
16
modules/default.nix
Normal file
16
modules/default.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./samba
|
||||
./apps/collabora
|
||||
./apps/dashy
|
||||
./apps/jellyfin
|
||||
./apps/jellyseerr
|
||||
./apps/mariadb
|
||||
./apps/nextcloud
|
||||
./apps/radarr
|
||||
./apps/sabnzbd
|
||||
./apps/sonarr
|
||||
./apps/swag
|
||||
];
|
||||
}
|
||||
67
modules/samba/default.nix
Normal file
67
modules/samba/default.nix
Normal file
@@ -0,0 +1,67 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nas-samba;
|
||||
in {
|
||||
imports = [
|
||||
./options.nix
|
||||
];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# make shares visible for Windows clients
|
||||
services.samba-wsdd = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
services.netatalk = {
|
||||
enable = cfg.enableTimeMachine;
|
||||
settings = {
|
||||
time-machine = {
|
||||
path = cfg.timeMachinePath;
|
||||
"valid users" = "whoever";
|
||||
"time machine" = cfg.enableTimeMachine;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.samba = {
|
||||
enable = true;
|
||||
securityType = "user";
|
||||
openFirewall = true;
|
||||
extraConfig = ''
|
||||
workgroup = WORKGROUP
|
||||
server string = smbnix
|
||||
netbios name = smbnix
|
||||
security = user
|
||||
#use sendfile = yes
|
||||
#max protocol = smb2
|
||||
# note: localhost is the ipv6 localhost ::1
|
||||
hosts allow = ${cfg.hostsAllow} 127.0.0.1 localhost
|
||||
hosts deny = 0.0.0.0/0
|
||||
guest account = nobody
|
||||
map to guest = bad user
|
||||
'';
|
||||
shares =
|
||||
let
|
||||
make = name: share: nameValuePair "${name}"
|
||||
{
|
||||
path = share.sharePath;
|
||||
public = if share.enableTimeMachine then false else share.public;
|
||||
private = if !share.public || share.enableTimeMachine then "yes" else "no";
|
||||
browseable = if share.browseable then "yes" else "no";
|
||||
writable = "yes";
|
||||
"read only" = if share.readOnly then "yes" else "no";
|
||||
"guest ok" = if share.guestOk then "yes" else "no";
|
||||
"create mask" = share.createMask;
|
||||
"directory mask" = share.directoryMask;
|
||||
"fruit:aapl" = if share.enableTimeMachine then "yes" else "no";
|
||||
"fruit:time machine" = if share.enableTimeMachine then "yes" else "no";
|
||||
"vfs objects" = "catia fruit streams_xattr";
|
||||
"fruit:time machine max size" = share.timeMachineMaxSize;
|
||||
};
|
||||
in
|
||||
mapAttrs' make cfg.shares;
|
||||
};
|
||||
};
|
||||
}
|
||||
70
modules/samba/options.nix
Normal file
70
modules/samba/options.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.nas-samba = {
|
||||
enable = mkEnableOption "nas samba service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
enableTimeMachine = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
timeMachinePath = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
hostsAllow = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
shares = mkOption {
|
||||
type = types.attrsOf (types.submodule
|
||||
{
|
||||
options = {
|
||||
public = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
sharePath = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
readOnly = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
browseable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
guestOk = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
createMask = mkOption {
|
||||
type = types.str;
|
||||
default = "0644";
|
||||
};
|
||||
directoryMask = mkOption {
|
||||
type = types.str;
|
||||
default = "0755";
|
||||
};
|
||||
enableTimeMachine = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
timeMachineMaxSize = mkOption {
|
||||
type = types.str;
|
||||
default = "0K";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user