hopeing
This commit is contained in:
@@ -38,6 +38,7 @@ in
|
||||
homelab = {
|
||||
enable = true;
|
||||
tailscale.enable = true;
|
||||
dnsmasq.enable = true;
|
||||
backups.enable = true;
|
||||
motd.enable = true;
|
||||
postfix.enable = true;
|
||||
|
||||
@@ -42,6 +42,7 @@ in
|
||||
# the order determines the order in glance :3
|
||||
imports = [
|
||||
./motd
|
||||
./dnsmasq
|
||||
./backups
|
||||
./glance
|
||||
./postfix
|
||||
|
||||
41
modules/homelab/dnsmasq/default.nix
Normal file
41
modules/homelab/dnsmasq/default.nix
Normal 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 ];
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user