Compare commits
3 Commits
c5466d559d
...
68a3339794
| Author | SHA1 | Date | |
|---|---|---|---|
| 68a3339794 | |||
| 9ef1cafc32 | |||
| e4ca52b587 |
@@ -1,7 +1,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
# this line prevents hanging on network split
|
# this line prevents hanging on network split
|
||||||
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
|
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.mount-timeout=5s";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.systemPackages = [ pkgs.cifs-utils ];
|
environment.systemPackages = [ pkgs.cifs-utils ];
|
||||||
@@ -17,12 +17,12 @@ in
|
|||||||
fileSystems."/data/media" = {
|
fileSystems."/data/media" = {
|
||||||
device = "//fractal/media";
|
device = "//fractal/media";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
options = [ "${automount_opts},credentials=/etc/nixos/smb-secrets" ];
|
options = [ "uid=1000,${automount_opts},credentials=/etc/nixos/smb-secrets" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/data/shared" = {
|
fileSystems."/data/shared" = {
|
||||||
device = "//fractal/shared";
|
device = "//fractal/shared";
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
options = [ "${automount_opts},credentials=/etc/nixos/smb-secrets" ];
|
options = [ "uid=1000,${automount_opts},credentials=/etc/nixos/smb-secrets" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
12
flake.lock
generated
12
flake.lock
generated
@@ -301,11 +301,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1746054057,
|
"lastModified": 1746330942,
|
||||||
"narHash": "sha256-iR+idGZJ191cY6NBXyVjh9QH8GVWTkvZw/w+1Igy45A=",
|
"narHash": "sha256-ShizFaJCAST23tSrHHtFFGF0fwd72AG+KhPZFFQX/0o=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "13ba07d54c6ccc5af30a501df669bf3fe3dd4db8",
|
"rev": "137fd2bd726fff343874f85601b51769b48685cc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -387,11 +387,11 @@
|
|||||||
"nuschtosSearch": "nuschtosSearch"
|
"nuschtosSearch": "nuschtosSearch"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1746300019,
|
"lastModified": 1746360866,
|
||||||
"narHash": "sha256-DGc6Wr4FUOGoEjazMcCRW8J2tSmsDlNM5wUrr2pNQz4=",
|
"narHash": "sha256-FYpcHko595nQ+d4KpwTj3o1cJUn912xaIxRb8rntz7I=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixvim",
|
"repo": "nixvim",
|
||||||
"rev": "90eb4e681c7dcb1ca4a929705d4a721163300449",
|
"rev": "f7f2dd042f28d235f7bf16cb31dbaee8f35159ca",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
214
services/media.hcl
Normal file
214
services/media.hcl
Normal file
@@ -0,0 +1,214 @@
|
|||||||
|
job "media" {
|
||||||
|
datacenters = ["alo"]
|
||||||
|
|
||||||
|
meta {
|
||||||
|
uuid = uuidv4()
|
||||||
|
}
|
||||||
|
|
||||||
|
group "servers" {
|
||||||
|
network {
|
||||||
|
port "radarr" { to = 7878 }
|
||||||
|
port "sonarr" { to = 8989 }
|
||||||
|
port "bazarr" { to = 6767 }
|
||||||
|
port "pms" { static = 32400 }
|
||||||
|
port "qbt_ui" { to = 8080 }
|
||||||
|
port "qbt_torrent" { static = 51413 }
|
||||||
|
}
|
||||||
|
|
||||||
|
task "radarr" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "ghcr.io/hotio/radarr:latest"
|
||||||
|
ports = [ "radarr" ]
|
||||||
|
volumes = [
|
||||||
|
"/data/compute/appdata/radarr:/config",
|
||||||
|
"/data/media:/data",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
PUID = 1000
|
||||||
|
PGID = 1000
|
||||||
|
TZ = "Europe/Lisbon"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 200
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "radarr"
|
||||||
|
port = "radarr"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"traefik.enable=true",
|
||||||
|
"traefik.http.routers.radarr.entryPoints=websecure",
|
||||||
|
"traefik.http.routers.radarr.middlewares=authentik@file",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "sonarr" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "ghcr.io/hotio/sonarr:latest"
|
||||||
|
ports = [ "sonarr" ]
|
||||||
|
volumes = [
|
||||||
|
"/data/compute/appdata/sonarr:/config",
|
||||||
|
"/data/media:/data",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
PUID = 1000
|
||||||
|
PGID = 1000
|
||||||
|
TZ = "Europe/Lisbon"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 200
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "sonarr"
|
||||||
|
port = "sonarr"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"traefik.enable=true",
|
||||||
|
"traefik.http.routers.sonarr.entryPoints=websecure",
|
||||||
|
"traefik.http.routers.sonarr.middlewares=authentik@file",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "bazarr" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "ghcr.io/hotio/bazarr:latest"
|
||||||
|
ports = [ "bazarr" ]
|
||||||
|
volumes = [
|
||||||
|
"/data/compute/appdata/bazarr:/config",
|
||||||
|
"/data/media/media:/data",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
PUID = 1000
|
||||||
|
PGID = 1000
|
||||||
|
TZ = "Europe/Lisbon"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 200
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "bazarr"
|
||||||
|
port = "bazarr"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"traefik.enable=true",
|
||||||
|
"traefik.http.routers.bazarr.entryPoints=websecure",
|
||||||
|
"traefik.http.routers.bazarr.middlewares=authentik@file",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "plex" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "plexinc/pms-docker:latest"
|
||||||
|
ports = [ "pms" ]
|
||||||
|
network_mode = "host"
|
||||||
|
volumes = [
|
||||||
|
"/data/compute/appdata/plex:/config",
|
||||||
|
"/data/media/media:/data",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
PLEX_UID = 1000
|
||||||
|
PLEX_GID = 1000
|
||||||
|
TZ = "Europe/Lisbon"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 2000
|
||||||
|
memory = 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "plex"
|
||||||
|
port = "pms"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"traefik.enable=true",
|
||||||
|
"traefik.http.routers.plex.entryPoints=websecure",
|
||||||
|
"traefik.http.routers.plex.middlewares=authentik@file",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "qbittorrent" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "lscr.io/linuxserver/qbittorrent:latest"
|
||||||
|
ports = [
|
||||||
|
"qbt_ui",
|
||||||
|
"qbt_torrent",
|
||||||
|
]
|
||||||
|
volumes = [
|
||||||
|
"/data/compute/appdata/qbittorrent:/config",
|
||||||
|
"/data/media/torrents:/data",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
PUID = 1000
|
||||||
|
PGID = 1000
|
||||||
|
TZ = "Europe/Lisbon"
|
||||||
|
TORRENTING_PORT = 51413
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 2000
|
||||||
|
memory = 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "torrent"
|
||||||
|
port = "qbt_ui"
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"traefik.enable=true",
|
||||||
|
"traefik.http.routers.torrent.entryPoints=websecure",
|
||||||
|
"traefik.http.routers.torrent.middlewares=authentik@file",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "keepalived" {
|
||||||
|
driver = "docker"
|
||||||
|
env {
|
||||||
|
KEEPALIVED_INTERFACE = "eno1"
|
||||||
|
KEEPALIVED_VIRTUAL_IPS = "192.168.1.102/24"
|
||||||
|
KEEPALIVED_ROUTER_ID = "54" # defaults to 51
|
||||||
|
KEEPALIVED_UNICAST_PEERS = ""
|
||||||
|
KEEPALIVED_STATE = "MASTER"
|
||||||
|
KEEPALIVED_VIRTUAL_ROUTES = ""
|
||||||
|
}
|
||||||
|
config {
|
||||||
|
# 2.2.8 wasn't starting, reason unknown
|
||||||
|
image = "visibilityspots/keepalived:2.2.7"
|
||||||
|
network_mode = "host"
|
||||||
|
privileged = true
|
||||||
|
cap_add = ["NET_ADMIN", "NET_BROADCAST", "NET_RAW"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user