mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 02:09:04 +02:00
Refactored modules
This commit is contained in:
parent
56c0af44ca
commit
f4f5d6e869
16 changed files with 368 additions and 24 deletions
41
modules/jellyfin/default.nix
Normal file
41
modules/jellyfin/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.luj.jellyfin;
|
||||
port = 8096;
|
||||
in {
|
||||
|
||||
options.luj.jellyfin = {
|
||||
enable = mkEnableOption "activate jellyfin service";
|
||||
nginx.enable = mkEnableOption "activate nginx";
|
||||
nginx.subdomain = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (
|
||||
mkMerge [{
|
||||
services.jellyfin = {
|
||||
enable = true;
|
||||
group = "tv";
|
||||
package = pkgs.jellyfin;
|
||||
};
|
||||
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