Compare commits
No commits in common. "59dc4a7ee1a00e71849e35974ea86518568c1251" and "f02cb085700a75f4a7751aa173b19ee6aef97f76" have entirely different histories.
59dc4a7ee1
...
f02cb08570
10 changed files with 91 additions and 126 deletions
|
|
@ -350,24 +350,21 @@
|
||||||
webuiPort = 8084;
|
webuiPort = 8084;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
filebot-cleanup = {
|
||||||
|
enable = false;
|
||||||
|
licenseFile = "/srv/jellyfin/filebot_license.psm";
|
||||||
|
};
|
||||||
|
|
||||||
sonarr = {
|
sonarr = {
|
||||||
enable = true;
|
enable = false;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
radarr = {
|
radarr = {
|
||||||
enable = true;
|
enable = false;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
bazarr = {
|
bazarr = {
|
||||||
enable = true;
|
enable = false;
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
jackett = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true;
|
|
||||||
};
|
|
||||||
flaresolverr = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,6 @@
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
|
./filebot.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
82
configurations/nixos/defiant/filebot.nix
Normal file
82
configurations/nixos/defiant/filebot.nix
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.services.filebot-cleanup;
|
||||||
|
in {
|
||||||
|
options.services.filebot-cleanup = {
|
||||||
|
enable = mkEnableOption "Filebot cleanup service";
|
||||||
|
|
||||||
|
licenseFile = mkOption {
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
description = "Path to the Filebot license file";
|
||||||
|
};
|
||||||
|
|
||||||
|
cleanupDirectory = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "/srv/jellyfin/filebot_cleanup";
|
||||||
|
description = "Directory where cleaned up media files are stored";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
users.groups.filebot_cleanup = {};
|
||||||
|
users.users.filebot_cleanup = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "filebot_cleanup";
|
||||||
|
extraGroups = ["jellyfin_media"];
|
||||||
|
home = cfg.cleanupDirectory;
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||||
|
builtins.elem (lib.getName pkg) [
|
||||||
|
"filebot"
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
filebot
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.services.filebot-cleanup = {
|
||||||
|
description = "Filebot media cleanup service";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
User = "filebot_cleanup";
|
||||||
|
Group = "filebot_cleanup";
|
||||||
|
ExecStart = pkgs.writeShellScript "filebot-cleanup" ''
|
||||||
|
${optionalString (cfg.licenseFile != null) ''
|
||||||
|
${pkgs.filebot}/bin/filebot --license "${cfg.licenseFile}"
|
||||||
|
''}
|
||||||
|
${pkgs.filebot}/bin/filebot -rename -r "/srv/jellyfin/media/Movies/" --output "${cfg.cleanupDirectory}/" --format "{jellyfin}" -non-strict --action duplicate
|
||||||
|
${pkgs.filebot}/bin/filebot -rename -r "/srv/jellyfin/media/Shows/" --output "${cfg.cleanupDirectory}/" --format "{jellyfin}" -non-strict --action duplicate
|
||||||
|
'';
|
||||||
|
StandardOutput = "journal";
|
||||||
|
StandardError = "journal";
|
||||||
|
};
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.persistence = lib.mkIf config.host.impermanence.enable {
|
||||||
|
"/persist/system/jellyfin" = {
|
||||||
|
enable = true;
|
||||||
|
hideMounts = true;
|
||||||
|
files = [
|
||||||
|
cfg.licenseFile
|
||||||
|
];
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
directory = cfg.cleanupDirectory;
|
||||||
|
user = "filebot_cleanup";
|
||||||
|
group = "filebot_cleanup";
|
||||||
|
mode = "1770";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
./actual
|
./actual
|
||||||
./bazarr
|
./bazarr
|
||||||
./flaresolverr
|
|
||||||
./forgejo
|
./forgejo
|
||||||
./home-assistant
|
./home-assistant
|
||||||
./immich
|
./immich
|
||||||
|
|
@ -19,7 +18,6 @@
|
||||||
./radarr
|
./radarr
|
||||||
./searx
|
./searx
|
||||||
./sonarr
|
./sonarr
|
||||||
./jackett
|
|
||||||
./wyoming.nix
|
./wyoming.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{...}: {
|
|
||||||
imports = [
|
|
||||||
./proxy.nix
|
|
||||||
./impermanence.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
config = lib.mkIf (config.services.flaresolverr.enable && config.host.impermanence.enable) {
|
|
||||||
# FlareSolverr typically doesn't need persistent storage as it's a proxy service
|
|
||||||
# but we'll add basic structure in case it's needed for logs or configuration
|
|
||||||
environment.persistence."/persist/system/root" = {
|
|
||||||
directories = [
|
|
||||||
{
|
|
||||||
directory = "/var/lib/flaresolverr";
|
|
||||||
user = "flaresolverr";
|
|
||||||
group = "flaresolverr";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
options.services.flaresolverr = {
|
|
||||||
subdomain = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
default = null;
|
|
||||||
description = "Subdomain for reverse proxy. If null, service will be local only.";
|
|
||||||
};
|
|
||||||
extraSubdomains = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [];
|
|
||||||
description = "Extra subdomains for reverse proxy.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf (config.services.flaresolverr.enable && config.services.flaresolverr.subdomain != null) {
|
|
||||||
host.reverse_proxy.subdomains.flaresolverr = {
|
|
||||||
subdomain = config.services.flaresolverr.subdomain;
|
|
||||||
extraSubdomains = config.services.flaresolverr.extraSubdomains;
|
|
||||||
target = "http://127.0.0.1:${toString config.services.flaresolverr.port}";
|
|
||||||
websockets.enable = true;
|
|
||||||
forwardHeaders.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
{...}: {
|
|
||||||
imports = [
|
|
||||||
./proxy.nix
|
|
||||||
./impermanence.nix
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
jackett_data_directory = "/var/lib/jackett/.config/Jackett";
|
|
||||||
in {
|
|
||||||
config = lib.mkIf (config.services.jackett.enable && config.host.impermanence.enable) {
|
|
||||||
assertions = [
|
|
||||||
{
|
|
||||||
assertion = config.services.jackett.dataDir == jackett_data_directory;
|
|
||||||
message = "jackett data directory does not match persistence";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.persistence."/persist/system/root" = {
|
|
||||||
directories = [
|
|
||||||
{
|
|
||||||
directory = jackett_data_directory;
|
|
||||||
user = "jackett";
|
|
||||||
group = "jackett";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
options.services.jackett = {
|
|
||||||
subdomain = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
default = null;
|
|
||||||
description = "Subdomain for reverse proxy. If null, service will be local only.";
|
|
||||||
};
|
|
||||||
extraSubdomains = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
default = [];
|
|
||||||
description = "Extra subdomains for reverse proxy.";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf (config.services.jackett.enable && config.services.jackett.subdomain != null) {
|
|
||||||
host.reverse_proxy.subdomains.jackett = {
|
|
||||||
subdomain = config.services.jackett.subdomain;
|
|
||||||
extraSubdomains = config.services.jackett.extraSubdomains;
|
|
||||||
target = "http://127.0.0.1:9117";
|
|
||||||
websockets.enable = true;
|
|
||||||
forwardHeaders.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue