update nas docker stuff
This commit is contained in:
38
modules/apps/deluge/default.nix
Normal file
38
modules/apps/deluge/default.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let cfg = config.nas-apps.deluge;
|
||||
in {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
systemd.services.deluge-docker = {
|
||||
path = [ pkgs.bash pkgs.docker ];
|
||||
script = ''
|
||||
set -e
|
||||
exec docker run \
|
||||
--rm \
|
||||
--cap-add=NET_ADMIN \
|
||||
--name=${cfg.name} \
|
||||
-e PUID=${cfg.puid} \
|
||||
-e PGID=${cfg.pgid} \
|
||||
-e TZ=${cfg.timeZone} \
|
||||
-p 8112:8112 \
|
||||
-p 8118:8118 \
|
||||
-p 58846:58846 \
|
||||
-p 58946:58966 \
|
||||
-v '${cfg.configPath}:/config' \
|
||||
-v '${cfg.moviesPath}:/data/downloads' \
|
||||
-v '${cfg.tvPath}:/data/downloads-icomplete' \
|
||||
-v /etc/localtime:/etc/localtime:ro \
|
||||
-e VPN_ENABLED=yes \
|
||||
-e VPN_PROV=custom \
|
||||
-e VPN_CLIENT=openvpn \
|
||||
-e LAN_NETWORK=10.0.1.0/24 \
|
||||
-e NAME_SERVERS=1.1.1.1 \
|
||||
${cfg.image}:latest
|
||||
'';
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
52
modules/apps/deluge/options.nix
Normal file
52
modules/apps/deluge/options.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{ lib, ... }:
|
||||
with lib; {
|
||||
options.nas-apps.deluge = {
|
||||
enable = mkEnableOption "deluge docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "deluge";
|
||||
};
|
||||
|
||||
image = mkOption {
|
||||
type = types.str;
|
||||
default = "binhex/arch-delugevpn";
|
||||
};
|
||||
|
||||
configPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/mnt/ssd/nix-app-data/deluge";
|
||||
};
|
||||
|
||||
moviesPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/mnt/ssd/ssd_app_data/downloads";
|
||||
};
|
||||
|
||||
tvPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/mnt/ssd/ssd_app_data/downloads-incomplete";
|
||||
};
|
||||
|
||||
puid = mkOption {
|
||||
type = types.str;
|
||||
default = "0";
|
||||
};
|
||||
|
||||
pgid = mkOption {
|
||||
type = types.str;
|
||||
default = "0";
|
||||
};
|
||||
|
||||
timeZone = mkOption {
|
||||
type = types.str;
|
||||
default = "America/Chicago";
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
23
modules/apps/jackett/default.nix
Normal file
23
modules/apps/jackett/default.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let cfg = config.nas-apps.jackett;
|
||||
in {
|
||||
imports = [ ./options.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers."${cfg.name}" = {
|
||||
autoStart = cfg.autoStart;
|
||||
image = cfg.image;
|
||||
ports = [ "${cfg.port}:9117" ];
|
||||
volumes = [
|
||||
"${cfg.configPath}:/config"
|
||||
"${cfg.downloadsPath}:/downloads"
|
||||
];
|
||||
environment = {
|
||||
PUID = cfg.puid;
|
||||
PGID = cfg.pgid;
|
||||
TZ = cfg.timeZone;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
51
modules/apps/jackett/options.nix
Normal file
51
modules/apps/jackett/options.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{ lib, ... }:
|
||||
with lib; {
|
||||
options.nas-apps.jackett = {
|
||||
enable = mkEnableOption "jackett docker service";
|
||||
|
||||
autoStart = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.str;
|
||||
default = "9117";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
default = "jackett";
|
||||
};
|
||||
|
||||
image = mkOption {
|
||||
type = types.str;
|
||||
default = "linuxserver/jackett";
|
||||
};
|
||||
|
||||
configPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/mnt/ssd/nix-app-data/jackett";
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user