restructure modules

This commit is contained in:
Pim Kunis 2024-01-07 23:06:27 +01:00
parent 11ec763244
commit aba16d3fd1
7 changed files with 51 additions and 49 deletions

View file

@ -24,8 +24,10 @@
hostName = "atlas.hyp"; hostName = "atlas.hyp";
nixosModule.lab = { nixosModule.lab = {
dns.enable = true; networking = {
networking.staticDMZIpv4Address = "192.168.30.7/24"; staticDMZIpv4Address = "192.168.30.7/24";
dmzServices.enable = true;
};
storage = { storage = {
osDisk = "/dev/sda"; osDisk = "/dev/sda";
@ -46,7 +48,6 @@
nixosModule.lab = { nixosModule.lab = {
dataHost.enable = true; dataHost.enable = true;
# dns.enable = true;
storage = { storage = {
osDisk = "/dev/sda"; osDisk = "/dev/sda";

View file

@ -9,9 +9,8 @@ in
./ssh-certificates.nix ./ssh-certificates.nix
./k3s ./k3s
./backups.nix ./backups.nix
./networking.nix ./networking
./data-sharing.nix ./data-sharing.nix
./dns
]; ];
options.lab.dataHost.enable = lib.mkOption { options.lab.dataHost.enable = lib.mkOption {

View file

@ -1,6 +1,8 @@
{ lib, config, ... }: { lib, config, ... }:
let cfg = config.lab.networking; let cfg = config.lab.networking;
in { in {
imports = [ ./dmz ];
options.lab.networking = { options.lab.networking = {
allowDMZConnectivity = lib.mkOption { allowDMZConnectivity = lib.mkOption {
default = false; default = false;

View file

@ -1,6 +1,6 @@
{ pkgs, lib, config, dns, ... }: { pkgs, lib, config, dns, ... }:
let let
cfg = config.lab.dns; cfg = config.lab.networking.dmzServices;
publicIpv4 = "192.145.57.90"; publicIpv4 = "192.145.57.90";
kunisZoneFile = pkgs.writeTextFile { kunisZoneFile = pkgs.writeTextFile {
name = "kunis-zone-file"; name = "kunis-zone-file";
@ -13,7 +13,7 @@ let
}; };
in in
{ {
options.lab.dns.enable = lib.mkOption { options.lab.networking.dmzServices.enable = lib.mkOption {
default = false; default = false;
type = lib.types.bool; type = lib.types.bool;
description = '' description = ''
@ -65,48 +65,7 @@ in
dnsmasq = { dnsmasq = {
enable = true; enable = true;
settings = import ./dnsmasq.nix;
settings = {
no-resolv = true;
server = [
"192.168.30.1"
"/geokunis2.nl/192.168.30.7"
"/kun.is/192.168.30.7"
];
local = "/dmz/";
dhcp-fqdn = true;
no-hosts = true;
expand-hosts = true;
domain = "dmz";
dhcp-authoritative = true;
dhcp-range = [
"192.168.30.50,192.168.30.127,15m"
"2a02:58:19a:f730::, ra-stateless, ra-names"
];
dhcp-host = [
"b8:27:eb:b9:ab:e2,esrom"
"ca:fe:c0:ff:ee:03,max,192.168.30.3"
"ca:fe:c0:ff:ee:08,maestro,192.168.30.8"
"dc:a6:32:7b:e2:11,iris,192.168.30.9"
"ca:fe:c0:ff:ee:0a,thecloud,192.168.30.10"
"52:54:00:72:e0:9a,forum,192.168.30.11"
];
dhcp-option = [
"3,192.168.30.1"
"option6:dns-server,[2a02:58:19a:f730::1]"
"option:dns-server,192.168.30.1"
];
ra-param = "*,0,0";
alias = "192.145.57.90,192.168.30.8";
log-dhcp = true;
log-queries = true;
interface-name = "hermes.dmz,ens3";
port = "5353";
address = [
"/ns.pizzapim.nl/ns.geokunis2.nl/ns.pim.kunis.nl/192.168.30.7"
"/ns.pizzapim.nl/ns.geokunis2.nl/ns.pim.kunis.nl/2a02:58:19a:f730:c8fe:c0ff:feff:ee07"
];
};
}; };
}; };
}; };

View file

@ -0,0 +1,41 @@
{
no-resolv = true;
server = [
"192.168.30.1"
"/geokunis2.nl/192.168.30.7"
"/kun.is/192.168.30.7"
];
local = "/dmz/";
dhcp-fqdn = true;
no-hosts = true;
expand-hosts = true;
domain = "dmz";
dhcp-authoritative = true;
dhcp-range = [
"192.168.30.50,192.168.30.127,15m"
"2a02:58:19a:f730::, ra-stateless, ra-names"
];
dhcp-host = [
"b8:27:eb:b9:ab:e2,esrom"
"ca:fe:c0:ff:ee:03,max,192.168.30.3"
"ca:fe:c0:ff:ee:08,maestro,192.168.30.8"
"dc:a6:32:7b:e2:11,iris,192.168.30.9"
"ca:fe:c0:ff:ee:0a,thecloud,192.168.30.10"
"52:54:00:72:e0:9a,forum,192.168.30.11"
];
dhcp-option = [
"3,192.168.30.1"
"option6:dns-server,[2a02:58:19a:f730::1]"
"option:dns-server,192.168.30.1"
];
ra-param = "*,0,0";
alias = "192.145.57.90,192.168.30.8";
log-dhcp = true;
log-queries = true;
interface-name = "hermes.dmz,ens3";
port = "5353";
address = [
"/ns.pizzapim.nl/ns.geokunis2.nl/ns.pim.kunis.nl/192.168.30.7"
"/ns.pizzapim.nl/ns.geokunis2.nl/ns.pim.kunis.nl/2a02:58:19a:f730:c8fe:c0ff:feff:ee07"
];
}