chore: arr to NAS
This commit is contained in:
@@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
metadata,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
ips = lib.filterAttrs (_k: v: v ? "ip" && v.ip != null) metadata.hosts;
|
|
||||||
tps = lib.filterAttrs (_k: v: v ? "ts" && v.ts != null) metadata.hosts;
|
|
||||||
get = field: set: lib.mapAttrsToList (_k: v: v.${field}) set;
|
|
||||||
getTS = get "ts" tps;
|
|
||||||
getIP = get "ip" ips;
|
|
||||||
whitelists = builtins.concatStringsSep "," (
|
|
||||||
[
|
|
||||||
"localhost"
|
|
||||||
"127.0.0.1"
|
|
||||||
]
|
|
||||||
++ getTS
|
|
||||||
++ getIP
|
|
||||||
);
|
|
||||||
in
|
|
||||||
{
|
|
||||||
services = {
|
|
||||||
prowlarr = {
|
|
||||||
enable = true;
|
|
||||||
dataDir = "/arr/prowlarr";
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
radarr = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
transmission = {
|
|
||||||
enable = true;
|
|
||||||
openPeerPorts = true;
|
|
||||||
openRPCPort = true;
|
|
||||||
package = pkgs.transmission_4;
|
|
||||||
settings = {
|
|
||||||
download-dir = "/arr/transmission/downloads";
|
|
||||||
rpc-bind-address = "0.0.0.0";
|
|
||||||
rpc-host-whitelist = whitelists;
|
|
||||||
rpc-host-whitelist-enabled = false;
|
|
||||||
rpc-whitelist = whitelists;
|
|
||||||
rpc-whitelist-enabled = false;
|
|
||||||
watch-dir-enabled = true;
|
|
||||||
watch-dir = "/arr/transmission/incoming";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.mounts =
|
|
||||||
let
|
|
||||||
nfs = name: {
|
|
||||||
what = "nas1.shire-zebra.ts.net:/mnt/all/${name}";
|
|
||||||
type = "nfs";
|
|
||||||
name = "${name}.mount";
|
|
||||||
where = "/${name}";
|
|
||||||
requires = [ "tailscaled-autoconnect.service" ];
|
|
||||||
after = [ "tailscaled-autoconnect.service" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
mountConfig.Options = "_netdev,noexec,timeo=50,retrans=5,soft";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
[
|
|
||||||
(nfs "arr")
|
|
||||||
(nfs "music")
|
|
||||||
(nfs "photos")
|
|
||||||
(nfs "video")
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,6 @@ in
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./arr.nix
|
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
top.niks3.nixosModules.niks3
|
top.niks3.nixosModules.niks3
|
||||||
];
|
];
|
||||||
@@ -200,6 +199,25 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.mounts =
|
||||||
|
let
|
||||||
|
nfs = name: {
|
||||||
|
what = "nas1.shire-zebra.ts.net:/mnt/all/${name}";
|
||||||
|
type = "nfs";
|
||||||
|
name = "${name}.mount";
|
||||||
|
where = "/${name}";
|
||||||
|
requires = [ "tailscaled-autoconnect.service" ];
|
||||||
|
after = [ "tailscaled-autoconnect.service" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
mountConfig.Options = "_netdev,noexec,timeo=50,retrans=5,soft";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
[
|
||||||
|
(nfs "music")
|
||||||
|
(nfs "photos")
|
||||||
|
(nfs "video")
|
||||||
|
];
|
||||||
|
|
||||||
# After first deploy: create a Grafana service account + API token for Klaatu
|
# After first deploy: create a Grafana service account + API token for Klaatu
|
||||||
# via the Grafana UI, then encrypt it: agenix -e secrets/grafana-api-token.age
|
# via the Grafana UI, then encrypt it: agenix -e secrets/grafana-api-token.age
|
||||||
age.secrets.grafana-api-token = {
|
age.secrets.grafana-api-token = {
|
||||||
|
|||||||
@@ -399,16 +399,24 @@
|
|||||||
name = "Media";
|
name = "Media";
|
||||||
bookmarks = [
|
bookmarks = [
|
||||||
{
|
{
|
||||||
name = "Prowlarr";
|
name = "Flaresolverr";
|
||||||
url = "https://hosea.shire-zebra.ts.net:9696/";
|
url = "http://nas1.shire-zebra.ts.net:30098";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "Transmission";
|
name = "Prowlarr";
|
||||||
url = "https://hosea.shire-zebra.ts.net:9091/";
|
url = "http://nas1.shire-zebra.ts.net:30050/";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "Sonarr (TV)";
|
||||||
|
url = "http://nas1.shire-zebra.ts.net:30113/";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "Radarr (Movies)";
|
name = "Radarr (Movies)";
|
||||||
url = "https://hosea.shire-zebra.ts.net:7878/";
|
url = "http://nas1.shire-zebra.ts.net:30025/";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "Transmission";
|
||||||
|
url = "http://nas1.shire-zebra.ts.net:30096/";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user