mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 10:09:04 +02:00
Refactored modules
This commit is contained in:
parent
56c0af44ca
commit
f4f5d6e869
16 changed files with 368 additions and 24 deletions
39
modules/jackett/default.nix
Normal file
39
modules/jackett/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.luj.jackett;
|
||||
port = 9117;
|
||||
in {
|
||||
|
||||
options.luj.jackett = {
|
||||
enable = mkEnableOption "activate jackett service";
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [{
|
||||
services.jackett = {
|
||||
enable = true;
|
||||
};
|
||||
networking.firewall = { allowedTCPPorts = [ port ]; };
|
||||
}
|
||||
|
||||
(mkIf cfg.nginx.enable {
|
||||
services.nginx.virtualHosts."${cfg.nginx.subdomain}.julienmalka.me" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString port}";
|
||||
};
|
||||
};
|
||||
|
||||
})
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue