This commit is contained in:
2025-11-04 23:43:29 -06:00
parent 610513edb7
commit 96ca6c6ea0
3 changed files with 43 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ in
homelab = {
enable = true;
tailscale.enable = true;
dnsmasq.enable = true;
backups.enable = true;
motd.enable = true;
postfix.enable = true;

View File

@@ -42,6 +42,7 @@ in
# the order determines the order in glance :3
imports = [
./motd
./dnsmasq
./backups
./glance
./postfix

View File

@@ -0,0 +1,41 @@
{
pkgs,
config,
lib,
...
}: let
service = "dnsmasq";
cfg = config.homelab.${service};
sec = config.sops.secrets;
homelab = config.homelab;
in {
options.homelab.${service} = {
enable = lib.mkEnableOption "enables ${service}";
port = lib.mkOption {
type = lib.types.int;
default = 53;
description = "set port for ${service} (default: ${toString cfg.port}";
};
};
config = lib.mkIf cfg.enable {
# enable the ${service} service
services.${service} = {
enable = true;
settings = {
listen-address = "10.10.0.10"; # your LAN IP
bind-interfaces = true;
address = "/snowbelle.lan/10.10.0.10";
server = [ # upstream dns
"9.9.9.9"
"1.1.1.1"
];
};
};
# open firewall
networking.firewall.allowedTCPPorts = [ cfg.port ];
networking.firewall.allowedUDPPorts = [ cfg.port ];
};
}