28 current 2025-10-07 15:30:08 25.05.20251001.5b5be50 6.12.49 *

This commit is contained in:
2025-10-07 15:46:39 -05:00
parent 49079aa26f
commit 0532a731e5
3 changed files with 34 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
# flake for blakes nixos config # flake for blakes nixos config
# define new devices in outputs # define new devices in outputs
# generation: 27 current 2025-10-07 15:29:13 25.05.20251001.5b5be50 6.12.49 * # generation: 28 current 2025-10-07 15:30:08 25.05.20251001.5b5be50 6.12.49 *
{ {
description = "blakes nix config"; description = "blakes nix config";
inputs = { inputs = {

View File

@@ -55,19 +55,30 @@ in
systemd.services.<service_name>.serviceConfig = { UMask = lib.mkForce "0007"; }; systemd.services.<service_name>.serviceConfig = { UMask = lib.mkForce "0007"; };
# # open firewall # # open firewall
# networking.firewall.allowedTCPPorts = [ port ]; # networking.firewall.allowedTCPPorts = [ cfg.port ];
# reverse proxy entryo # internal reverse proxy entry
services.nginx.virtualHosts."<service_name>.snowbelle.lan" = { services.nginx.virtualHosts."<service_name>.snowbelle.lan" = {
enableACME = false; enableACME = false;
forceSSL = true; forceSSL = true;
sslCertificate = config.sops.secrets."ssl_blakedheld_crt".path; sslCertificate = config.sops.secrets."ssl_blakedheld_crt".path;
sslCertificateKey = config.sops.secrets."ssl_blakedheld_key".path; sslCertificateKey = config.sops.secrets."ssl_blakedheld_key".path;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:${toString port}"; proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
# external reverse proxy entry
services.nginx.virtualHosts."<service_name>.blakedheld.xyz" = {
enableACME = false;
forceSSL = true;
sslCertificate = config.sops.secrets."ssl_blakedheld_crt".path;
sslCertificateKey = config.sops.secrets."ssl_blakedheld_key".path;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cfg.port}";
}; };
}; };
};
# add to backups # add to backups
modules.system.backups.paths = lib.mkIf cfg.backup [ data_dir ]; modules.system.backups.paths = lib.mkIf cfg.backup [ data_dir ];
}; };

View File

@@ -3,17 +3,24 @@
let let
cfg = config.modules.services.jellyfin; cfg = config.modules.services.jellyfin;
ids = 701; ids = 701;
default_port = 8096;
data_dir = "/var/lib/jellyfin";
in in
{ {
options.modules.services.jellyfin = { options.modules.services.jellyfin = {
enable = lib.mkEnableOption "enables jellyfin"; enable = lib.mkEnableOption "enables jellyfin";
# extra options
# mode = lib.mkOption {
# type = lib.types.enum [ "server" "client" ];
# default = "client";
# description = "whether syncthing should run as a client (user) or server (system-wide).";
# };
# set port options
port = lib.mkOption {
type = lib.types.int;
default = cfg.default_port;
description = "set port for jellyfin (default: ${toString default_port}";
};
backup = lib.mkOption {
type = lib.types.bool;
default = true;
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@@ -26,7 +33,7 @@ in
description = "jellyfin media server user"; description = "jellyfin media server user";
uid = ids; uid = ids;
isSystemUser = true; isSystemUser = true;
home = "/var/lib/jellyfin"; home = data_dir;
createHome = true; createHome = true;
group = "jellyfin"; group = "jellyfin";
extraGroups = [ "media" "video" "render" ]; extraGroups = [ "media" "video" "render" ];
@@ -45,7 +52,7 @@ in
systemd.services.jellyfin.serviceConfig = { UMask = lib.mkForce "0007"; }; systemd.services.jellyfin.serviceConfig = { UMask = lib.mkForce "0007"; };
# open firewall # open firewall
#networking.firewall.allowedTCPPorts = [ 8096 ]; # networking.firewall.allowedTCPPorts = [ cfg.port ];
# reverse proxy entryo # reverse proxy entryo
services.nginx.virtualHosts."media.blakedheld.xyz" = { services.nginx.virtualHosts."media.blakedheld.xyz" = {
@@ -54,8 +61,11 @@ in
sslCertificate = config.sops.secrets."ssl_blakedheld_crt".path; sslCertificate = config.sops.secrets."ssl_blakedheld_crt".path;
sslCertificateKey = config.sops.secrets."ssl_blakedheld_key".path; sslCertificateKey = config.sops.secrets."ssl_blakedheld_key".path;
locations."/" = { locations."/" = {
proxyPass = "http://127.0.0.1:8096"; proxyPass = "http://127.0.0.1:${toString cfg.port}";
}; };
}; };
# add to backups
modules.system.backups.paths = lib.mkIf cfg.backup [ data_dir ];
}; };
} }