This commit is contained in:
chris 2025-04-17 11:57:26 +02:00
parent 948bd1ad45
commit 0bbf499b29
Signed by: c6ristian
SSH key fingerprint: SHA256:B3m+yzpaxGXSEcDBpPHfvza/DNC0wuX+CKMeGq8wgak
3 changed files with 93 additions and 3 deletions
systems

View file

@ -50,9 +50,7 @@ in
# prod hosts (public user)
"cookies.eh22.intern" = mkSystem "x86_64-linux" "cookies.eh22.intern";
"jool.eh22.intern" = mkSystem "x86_64-linux" "jool.eh22.intern";
# staging temp infra
"sketchy-router.noc.eh22.intern" = mkSystem "x86_64-linux" "sketchy-router.noc.eh22.intern";
"dhcp.eh22.intern" = mkSystem "x86_64-linux" "dhcp.eh22.intern";
# misc hosts
"test.eh22.intern" = mkSystem "x86_64-linux" "test.eh22.intern";

View file

@ -0,0 +1,58 @@
{ config, pkgs, ... }:
{
services.kea.dhcp4 = {
enable = true;
settings = {
lease-database = {
name = "/var/lib/kea/dhcp4.leases";
persist = true;
type = "memfile";
};
rebind-timer = 2000;
renew-timer = 1000;
valid-lifetime = 4000;
authoritative = true;
option-data = [
{
name = "domain-name-servers";
data = "94.45.254.2";
}
{
name = "cookie-servers";
data = "94.45.254.3";
always-send = true;
}
];
shared-networks = [
{
# wifi
id = 224;
subnet = "94.45.224.0/20";
pools = [ { pool = "94.45.224.10 - 94.45.239.254"; } ];
option-data = [
{
name = "routers";
data = "94.45.224.1";
}
];
}
{
# wired
id = 240;
subnet = "94.45.240.0/21";
pools = [ { pool = "94.45.240.10 - 94.45.240.254"; } ];
option-data = [
{
name = "routers";
data = "94.45.240.1";
}
];
}
];
};
};
}

View file

@ -0,0 +1,34 @@
{
pkgs,
config,
...
}:
{
imports = [
./kea.nix
];
networking = {
interfaces = {
net0 = {
ipv4 = {
addresses = [
{
address = "94.45.240.3";
prefixLength = 21;
}
];
};
};
};
defaultGateway = "94.45.240.1";
};
systemd.network.links."10-net0" = {
matchConfig.MACAddress = "BC:24:11:BE:24:52";
linkConfig.Name = "net0";
};
# DO NOT CHANGE
# this defines the first version of NixOS that was installed on the machine so that programs with non-migratable data files are kept compatible
home-manager.users.noc.home.stateVersion = "24.11";
system.stateVersion = "24.11";
}