snowfield/modules/jackett/default.nix

57 lines
1.3 KiB
Nix
Raw Normal View History

2024-05-23 18:35:14 +02:00
{
lib,
config,
pkgs,
...
}:
2021-12-04 13:13:13 +01:00
with lib;
let
2021-12-04 13:13:13 +01:00
cfg = config.luj.jackett;
port = 9117;
in
{
options.luj.jackett = {
enable = mkEnableOption "activate jackett service";
user = mkOption {
type = types.str;
default = "jackett";
description = "User account under which Jackett runs.";
};
group = mkOption {
type = types.str;
default = "jackett";
description = "Group under which Jackett runs.";
};
2021-12-04 13:13:13 +01:00
nginx.enable = mkEnableOption "activate nginx";
2024-05-23 18:35:14 +02:00
nginx.subdomain = mkOption { type = types.str; };
2021-12-04 13:13:13 +01:00
};
2024-05-23 18:35:14 +02:00
config = mkIf cfg.enable (mkMerge [
{
services.jackett = {
enable = true;
2024-05-23 18:35:14 +02:00
# unstable version to have updated torrent list
2024-11-30 20:46:38 +01:00
package = pkgs.unstable.jackett.overrideAttrs (
_: _: {
2025-01-03 00:16:39 +01:00
doCheck = false;
2024-11-30 20:46:38 +01:00
postInstall = ''
cp ${./ygg-api.yml} $out/lib/jackett/Definitions/ygg-api.yml
'';
}
);
2024-03-30 20:58:04 +01:00
inherit (cfg) user group;
2021-12-04 13:13:13 +01:00
};
2025-01-18 00:25:18 +01:00
machine.meta.probes.monitors."jackett.luj - IPv4".accepted_statuscodes = [ "400" ];
machine.meta.probes.monitors."jackett.luj - IPv6".accepted_statuscodes = [ "400" ];
}
2024-05-23 18:35:14 +02:00
(mkIf cfg.nginx.enable (mkVPNSubdomain cfg.nginx.subdomain port))
]);
2021-12-04 13:13:13 +01:00
}