organization
This commit is contained in:
20
README.md
20
README.md
@@ -4,17 +4,17 @@
|
|||||||
* [flake.nix](./flake.nix)
|
* [flake.nix](./flake.nix)
|
||||||
|
|
||||||
### Desktop
|
### Desktop
|
||||||
* [configuration.nix](./configuration.nix)
|
* [configuration.nix](./hosts/desktop/configuration.nix)
|
||||||
* [hardware-configuration.nix](./hardware-configuration.nix)
|
* [hardware-configuration.nix](./hosts/desktop/hardware-configuration.nix)
|
||||||
* [home.nix](./home.nix)
|
* [home.nix](./hosts/desktop/home.nix)
|
||||||
* [impermenance.nix](./impermanence.nix)
|
* [impermenance.nix](./hosts/desktop/impermanence.nix)
|
||||||
* cachix
|
* cachix
|
||||||
* [cachix.nix](./cachix.nix)
|
* [cachix.nix](./cachix/cachix.nix)
|
||||||
* [nix-community.nix](./cachix/nix-community.nix)
|
* [nix-community.nix](./cachix/nix-community.nix)
|
||||||
|
|
||||||
### NAS
|
### NAS
|
||||||
* [configuration.nix](./configuration-nas.nix)
|
* [configuration.nix](./hosts/nas/configuration.nix)
|
||||||
* [hardware-configuration.nix](./hardware-configuration-nas.nix)
|
* [hardware-configuration.nix](./hosts/nas/hardware-configuration.nix)
|
||||||
* [samba](./nas-samba/samba.nix)
|
* [samba](./nas-samba/samba.nix)
|
||||||
* nas-apps
|
* nas-apps
|
||||||
* [swag](./nas-apps/swag.nix)
|
* [swag](./nas-apps/swag.nix)
|
||||||
@@ -27,6 +27,6 @@
|
|||||||
* [radarr](./nas-apps/radarr.nix)
|
* [radarr](./nas-apps/radarr.nix)
|
||||||
|
|
||||||
### Raspberry Pi 4
|
### Raspberry Pi 4
|
||||||
* [configuration.nix](./configuration-pi4.nix)
|
* [configuration.nix](./hosts/pi4/configuration.nix)
|
||||||
* [hardware-configuration.nix](./hardware-configuration-pi4.nix)
|
* [hardware-configuration.nix](./hosts/pi4/hardware-configuration.nix)
|
||||||
* [docker](./docker-pi4.nix)
|
* [docker](./hosts/pi4/docker-pi4.nix)
|
||||||
@@ -23,7 +23,7 @@ in
|
|||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./cachix.nix
|
./cachix/cachix.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable nix flakes and nix-command tools
|
# Enable nix flakes and nix-command tools
|
||||||
@@ -12,22 +12,38 @@ in
|
|||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware-configuration-nas.nix
|
./hardware-configuration.nix
|
||||||
./nas-samba/samba.nix
|
../../nas-samba/samba.nix
|
||||||
./nas-apps/swag.nix
|
../../nas-apps/nas-apps.nix
|
||||||
./nas-apps/jellyfin.nix
|
|
||||||
./nas-apps/sonarr.nix
|
|
||||||
./nas-apps/radarr.nix
|
|
||||||
./nas-apps/sabnzbd.nix
|
|
||||||
./nas-apps/mariadb.nix
|
|
||||||
./nas-apps/nextcloud.nix
|
|
||||||
./nas-apps/collabora.nix
|
|
||||||
./nas-apps/jellyseerr.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable nix flakes and nix-command tools
|
# Enable nix flakes and nix-command tools
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
|
nas-apps = {
|
||||||
|
jellyfin.enable = true;
|
||||||
|
|
||||||
|
jellyseerr.enable = true;
|
||||||
|
|
||||||
|
sabnzbd.enable = true;
|
||||||
|
|
||||||
|
radarr.enable = true;
|
||||||
|
|
||||||
|
sonarr.enable = true;
|
||||||
|
|
||||||
|
collabora.enable = true;
|
||||||
|
|
||||||
|
mariadb.enable = true;
|
||||||
|
|
||||||
|
nextcloud = {
|
||||||
|
enable = true;
|
||||||
|
httpPort = "9980";
|
||||||
|
httpsPort = "9443";
|
||||||
|
};
|
||||||
|
|
||||||
|
swag.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Configure bootloader with lanzaboot and secureboot
|
# Configure bootloader with lanzaboot and secureboot
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
loader = {
|
||||||
@@ -216,8 +232,8 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
allowPing = true;
|
allowPing = true;
|
||||||
extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns''; # TODO is this needed?
|
extraCommands = ''iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns''; # TODO is this needed?
|
||||||
allowedTCPPorts = [ 80 443 61208 ];
|
allowedTCPPorts = [ 61208 ];
|
||||||
allowedUDPPorts = [ 80 443 61208 ];
|
allowedUDPPorts = [ 61208 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1,9 +1,61 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
{
|
with lib;
|
||||||
# code
|
let
|
||||||
virtualisation.oci-containers.containers."collabora" = {
|
cfg = config.nas-apps.collabora;
|
||||||
autoStart = true;
|
in {
|
||||||
image = "collabora/code";
|
options.nas-apps.collabora = {
|
||||||
ports = [ "9980:9980" ];
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
17
nas-apps/dashy.nix
Normal file
17
nas-apps/dashy.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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,67 +1,128 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.nas-apps.jellyfin;
|
||||||
|
in {
|
||||||
|
options.nas-apps.jellyfin = {
|
||||||
|
enable = mkEnableOption "jellyfin docker service";
|
||||||
|
|
||||||
|
autoStart = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
{
|
port = mkOption {
|
||||||
# Jellyfin
|
type = types.str;
|
||||||
# Nix
|
default = "8096";
|
||||||
# environment.systemPackages = [
|
};
|
||||||
# pkgs.jellyfin
|
|
||||||
# pkgs.jellyfin-web
|
|
||||||
# pkgs.jellyfin-ffmpeg
|
|
||||||
# ];
|
|
||||||
|
|
||||||
# services.jellyfin = {
|
name = mkOption {
|
||||||
# enable = true;
|
type = types.str;
|
||||||
# user = "911";
|
default = "jellyfin";
|
||||||
# group = "1000";
|
};
|
||||||
# # dataDir = "/mnt/Safe\ SSD/ssd_app_data/jellyfin/config"; # defaults to /var/lib/jellyfin and cannot be changed....
|
|
||||||
# openFirewall = true;
|
|
||||||
|
|
||||||
# };
|
image = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "lscr.io/linuxserver/jellyfin";
|
||||||
|
};
|
||||||
|
|
||||||
# nix-docker
|
configPath = mkOption {
|
||||||
# virtualisation.oci-containers.containers."jellyfin" = {
|
type = types.str;
|
||||||
# autoStart = true;
|
default = "/mnt/ssd/nix-app-data/jellyfin";
|
||||||
# image = "linuxserver/jellyfin";
|
};
|
||||||
# cmd = [ "--gpus all" ];
|
|
||||||
# volumes = [
|
moviesPath = mkOption {
|
||||||
# "/mnt/Safe\ SSD/ssd_app_data/jellyfin/config:/config"
|
type = types.str;
|
||||||
# "/mnt/Safe\ SSD/ssd_app_data/jellyfin/cache:/cache"
|
default = "/mnt/mainpool/Movies";
|
||||||
# "/mnt/Safe\ SSD/ssd_app_data/jellyfin/log:/log"
|
};
|
||||||
# "/mnt/Main\ Pool/Movies:/movies"
|
|
||||||
# "/mnt/Main\ Pool/TV:/tv"
|
tvPath = mkOption {
|
||||||
# ];
|
type = types.str;
|
||||||
# ports = [ "8096:8096" ];
|
default = "/mnt/mainpool/Tv";
|
||||||
# environment = {
|
};
|
||||||
# NVIDIA_VISIBLE_DEVICES = "all";
|
|
||||||
# NVIDIA_DRIVER_CAPABILITIES = "compute,utility";
|
puid = mkOption {
|
||||||
# JELLYFIN_LOG_DIR = "/log";
|
type = types.str;
|
||||||
# PUID = "911";
|
default = "911";
|
||||||
# PGID = "1000";
|
};
|
||||||
# };
|
|
||||||
# };
|
pgid = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "1000";
|
||||||
|
};
|
||||||
|
|
||||||
|
timeZone = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "America/Chicago";
|
||||||
|
};
|
||||||
|
|
||||||
# Manual
|
|
||||||
systemd.services.jellyfin-nvidia-docker = {
|
|
||||||
path = [ pkgs.bash pkgs.docker ];
|
|
||||||
script = ''
|
|
||||||
set -e
|
|
||||||
exec docker run \
|
|
||||||
--rm \
|
|
||||||
--gpus all \
|
|
||||||
--runtime=nvidia \
|
|
||||||
--name=jellyfin \
|
|
||||||
-e PUID=911 \
|
|
||||||
-e PGID=1000 \
|
|
||||||
-e TZ=America/Chicago \
|
|
||||||
-e 'NVIDIA_DRIVER_CAPABILITIES'='all' \
|
|
||||||
-e 'NVIDIA_VISIBLE_DEVICES'='all' \
|
|
||||||
-p 8096:8096 \
|
|
||||||
-v '/mnt/ssd/nix-app-data/jellyfin:/config' \
|
|
||||||
-v '/mnt/mainpool/Movies:/data/movies' \
|
|
||||||
-v '/mnt/mainpool/TV:/data/tv' \
|
|
||||||
lscr.io/linuxserver/jellyfin:latest
|
|
||||||
'';
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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";
|
||||||
|
# # };
|
||||||
|
# # };
|
||||||
|
# }
|
||||||
@@ -1,17 +1,66 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
{
|
with lib;
|
||||||
# jellyseerr
|
let
|
||||||
virtualisation.oci-containers.containers."jellyseerr" = {
|
cfg = config.nas-apps.jellyseerr;
|
||||||
autoStart = true;
|
in {
|
||||||
image = "fallenbagel/jellyseerr";
|
options.nas-apps.jellyseerr = {
|
||||||
ports = [ "5055:5055" ];
|
enable = mkEnableOption "jellyseerr docker service";
|
||||||
volumes = [
|
|
||||||
"/mnt/ssd/ssd_app_data/jellyseerr:/config"
|
autoStart = mkOption {
|
||||||
];
|
type = types.bool;
|
||||||
environment = {
|
default = true;
|
||||||
PUID = "911";
|
};
|
||||||
PGID = "1000";
|
|
||||||
TZ = "America/Chicago";
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,90 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
{
|
with lib;
|
||||||
# mariadb
|
let
|
||||||
virtualisation.oci-containers.containers."mariadb" = {
|
cfg = config.nas-apps.mariadb;
|
||||||
autoStart = true;
|
in {
|
||||||
image = "linuxserver/mariadb";
|
options.nas-apps.mariadb = {
|
||||||
ports = [ "3306:3306" ];
|
enable = mkEnableOption "mariadb docker service";
|
||||||
volumes = [
|
|
||||||
"/mnt/ssd/mariadb:/config"
|
autoStart = mkOption {
|
||||||
];
|
type = types.bool;
|
||||||
environment = {
|
default = true;
|
||||||
PUID = "911";
|
};
|
||||||
PGID = "1000";
|
|
||||||
TZ = "America/Chicago";
|
port = mkOption {
|
||||||
MYSQL_ROOT_PASSWORD = "BogieDudie1";
|
type = types.str;
|
||||||
MYSQL_DATABASE = "jallen_nextcloud";
|
default = "3306";
|
||||||
MYSQL_USER = "nextcloud";
|
};
|
||||||
MYSQL_PASSWORD = "BogieDudie1";
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
16
nas-apps/nas-apps.nix
Normal file
16
nas-apps/nas-apps.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
./swag.nix
|
||||||
|
./jellyfin.nix
|
||||||
|
./sonarr.nix
|
||||||
|
./radarr.nix
|
||||||
|
./sabnzbd.nix
|
||||||
|
./mariadb.nix
|
||||||
|
./nextcloud.nix
|
||||||
|
./collabora.nix
|
||||||
|
./jellyseerr.nix
|
||||||
|
# ./dashy.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,18 +1,77 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
{
|
with lib;
|
||||||
# nextcloud
|
let
|
||||||
virtualisation.oci-containers.containers."nextcloud" = {
|
cfg = config.nas-apps.nextcloud;
|
||||||
autoStart = true;
|
in {
|
||||||
image = "linuxserver/nextcloud";
|
options.nas-apps.nextcloud = {
|
||||||
ports = [ "9443:443" "9880:80" ];
|
enable = mkEnableOption "nextcloud docker service";
|
||||||
volumes = [
|
|
||||||
"/mnt/ssd/ssd_app_data/nextcloud:/config"
|
autoStart = mkOption {
|
||||||
"/mnt/mainpool/Nextcloud:/data"
|
type = types.bool;
|
||||||
];
|
default = true;
|
||||||
environment = {
|
};
|
||||||
PUID = "911";
|
|
||||||
PGID = "1000";
|
httpPort = mkOption {
|
||||||
TZ = "America/Chicago";
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,78 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
{
|
with lib;
|
||||||
# radarr
|
let
|
||||||
virtualisation.oci-containers.containers."radarr" = {
|
cfg = config.nas-apps.radarr;
|
||||||
autoStart = true;
|
in {
|
||||||
image = "linuxserver/radarr";
|
options.nas-apps.radarr = {
|
||||||
ports = [ "7878:7878" ];
|
enable = mkEnableOption "radarr docker service";
|
||||||
volumes = [
|
|
||||||
"/mnt/ssd/ssd_app_data/radarr:/config"
|
autoStart = mkOption {
|
||||||
"/mnt/mainpool/Movies:/movies"
|
type = types.bool;
|
||||||
"/mnt/ssd/ssd_app_data/downloads:/downloads"
|
default = true;
|
||||||
];
|
};
|
||||||
environment = {
|
|
||||||
PUID = "911";
|
port = mkOption {
|
||||||
PGID = "1000";
|
type = types.str;
|
||||||
TZ = "America/Chicago";
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,90 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
{
|
with lib;
|
||||||
# sabnzbd
|
let
|
||||||
virtualisation.oci-containers.containers."sabnzbd" = {
|
cfg = config.nas-apps.sabnzbd;
|
||||||
autoStart = true;
|
in {
|
||||||
image = "linuxserver/sabnzbd";
|
options.nas-apps.sabnzbd = {
|
||||||
ports = [ "8080:8080" ];
|
enable = mkEnableOption "sabnzbd docker service";
|
||||||
volumes = [
|
|
||||||
"/mnt/ssd/ssd_app_data/sabnzbd:/config"
|
autoStart = mkOption {
|
||||||
"/mnt/mainpool/TV:/tv"
|
type = types.bool;
|
||||||
"/mnt/mainpool/Movies:/movies"
|
default = true;
|
||||||
"/mnt/ssd/ssd_app_data/downloads:/downloads"
|
};
|
||||||
"/mnt/ssd/ssd_app_data/downloads-incomplete:/downloads-incomplete"
|
|
||||||
];
|
port = mkOption {
|
||||||
environment = {
|
type = types.str;
|
||||||
PUID = "911";
|
default = "8080";
|
||||||
PGID = "1000";
|
};
|
||||||
TZ = "America/Chicago";
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,78 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
{
|
with lib;
|
||||||
# sonarr
|
let
|
||||||
virtualisation.oci-containers.containers."sonarr" = {
|
cfg = config.nas-apps.sonarr;
|
||||||
autoStart = true;
|
in {
|
||||||
image = "linuxserver/sonarr";
|
options.nas-apps.sonarr = {
|
||||||
ports = [ "8989:8989" ];
|
enable = mkEnableOption "sonarr docker service";
|
||||||
volumes = [
|
|
||||||
"/mnt/ssd/ssd_app_data/sonarr:/config"
|
autoStart = mkOption {
|
||||||
"/mnt/mainpool/TV:/tv"
|
type = types.bool;
|
||||||
"/mnt/ssd/ssd_app_data/downloads:/downloads"
|
default = true;
|
||||||
];
|
};
|
||||||
environment = {
|
|
||||||
PUID = "911";
|
port = mkOption {
|
||||||
PGID = "1000";
|
type = types.str;
|
||||||
TZ = "America/Chicago";
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,101 @@
|
|||||||
{ config, pkgs, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
{
|
with lib;
|
||||||
# Swag
|
let
|
||||||
virtualisation.oci-containers.containers."swag" = {
|
cfg = config.nas-apps.swag;
|
||||||
autoStart = true;
|
in {
|
||||||
image = "linuxserver/swag";
|
options.nas-apps.swag = {
|
||||||
ports = [ "80:80" "443:443" ];
|
enable = mkEnableOption "swag docker service";
|
||||||
volumes = [
|
|
||||||
"/mnt/ssd/ssd_app_data/swag:/config"
|
autoStart = mkOption {
|
||||||
];
|
type = types.bool;
|
||||||
environment = {
|
default = true;
|
||||||
PGID = "1000";
|
};
|
||||||
PUID = "1000";
|
|
||||||
EMAIL = "jalle008@proton.me";
|
httpPort = mkOption {
|
||||||
TZ = "America/Chicago";
|
type = types.int;
|
||||||
URL = "mjallen.dev";
|
default = 80;
|
||||||
VALIDATION = "http";
|
};
|
||||||
SUBDOMAINS = "jellyfin,hass,cloud,office,jellyseerr";
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user