dns swapover

This commit is contained in:
2026-05-12 23:22:03 -05:00
parent 37796783ad
commit 83c83e6bc8
3 changed files with 25 additions and 24 deletions
+21 -17
View File
@@ -1,12 +1,14 @@
{ pkgs, config, lib, ... }:
let
{
pkgs,
config,
lib,
...
}: let
service = "sonarr";
cfg = config.homelab.${service};
sec = config.sops.secrets;
homelab = config.homelab;
in
{
in {
options.homelab.${service} = {
enable = lib.mkEnableOption "enables ${service}";
@@ -43,12 +45,11 @@ in
};
config = lib.mkIf cfg.enable {
# required
environment.systemPackages = with pkgs; [ffmpeg_6-headless];
# declare ${service} group
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
users.groups.${service} = {gid = lib.mkForce cfg.ids;};
# declare ${service} user
users.users.${service} = {
@@ -58,7 +59,7 @@ in
home = cfg.data_dir;
createHome = true;
group = service;
extraGroups = [ "media" ];
extraGroups = ["media"];
};
# enable the ${service} service
@@ -78,8 +79,8 @@ in
UMask = lib.mkForce "0007";
};
# # open firewall
# networking.firewall.allowedTCPPorts = [ cfg.port ];
# # open firewall
# networking.firewall.allowedTCPPorts = [ cfg.port ];
# add to caddy for reverse proxy
services.caddy.virtualHosts."${cfg.url}" = {
@@ -91,16 +92,19 @@ in
};
# add to glance
homelab.glance.links.mediastack = [{
title = service;
url = "https://${cfg.url}";
error-url = "http://${homelab.host_ip}:${toString cfg.port}";
check-url = "http://${homelab.host_ip}:${toString cfg.port}";
icon = "di:${service}"; }];
homelab.glance.links.mediastack = [
{
title = service;
url = "https://${cfg.url}";
error-url = "http://${homelab.host_ip}:${toString cfg.port}";
check-url = "http://${homelab.host_ip}:${toString cfg.port}";
icon = "di:${service}";
}
];
# add to backups
homelab.backups.baks = {
${service} = { paths = [ cfg.data_dir ]; };
${service} = {paths = [cfg.data_dir];};
};
};
}