♻️ consolidate nix configs
This commit is contained in:
45
nix/modules/coredns/default.nix
Normal file
45
nix/modules/coredns/default.nix
Normal file
@ -0,0 +1,45 @@
|
||||
{ config, lib, ... }:
|
||||
with lib;
|
||||
|
||||
let cfg = config.walkah.coredns;
|
||||
in
|
||||
{
|
||||
options.walkah.coredns = {
|
||||
enable = mkEnableOption "";
|
||||
addr = mkOption {
|
||||
type = types.str;
|
||||
default = "0.0.0.0";
|
||||
example = "192.168.6.1";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.coredns = {
|
||||
enable = true;
|
||||
config = ''
|
||||
. {
|
||||
bind 127.0.0.1
|
||||
bind ${cfg.addr}
|
||||
prometheus ${cfg.addr}:9153
|
||||
log
|
||||
errors
|
||||
cache
|
||||
dnssec
|
||||
forward . tls://1.1.1.1 tls://1.0.0.1 {
|
||||
tls_servername cloudflare-dns.com
|
||||
}
|
||||
}
|
||||
|
||||
walkah.lab {
|
||||
bind ${cfg.addr}
|
||||
file ${./walkah.lab.zone}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
networking = {
|
||||
nameservers = [ "127.0.0.1" ];
|
||||
search = [ "walkah.lab" ];
|
||||
};
|
||||
};
|
||||
}
|
19
nix/modules/coredns/walkah.lab.zone
Normal file
19
nix/modules/coredns/walkah.lab.zone
Normal file
@ -0,0 +1,19 @@
|
||||
$ORIGIN walkah.lab.
|
||||
@ 3600 IN SOA plato.walkah.lab. walkah.walkah.net. (
|
||||
2023091000 ; serial
|
||||
7200 ; refresh (2 hours)
|
||||
3600 ; retry (1 hour)
|
||||
1209600 ; expire (2 weeks)
|
||||
3600 ; minimum (1 hour)
|
||||
)
|
||||
|
||||
socrates IN A 100.103.57.96
|
||||
plato IN A 100.111.208.75
|
||||
; aristotle
|
||||
agent IN A 100.95.167.126
|
||||
form IN A 100.87.220.71
|
||||
matter IN A 100.126.255.109
|
||||
purpose IN A 100.74.59.80
|
||||
|
||||
parthenon IN A 100.106.65.39
|
||||
epicurus IN A 100.66.26.116
|
Reference in New Issue
Block a user