mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-22 16:04:25 +01:00
Setup static IP support in dhcpd
Signed-off-by: main <magic_rb@redalder.org>
This commit is contained in:
parent
2852b5f562
commit
b1381511dd
|
@ -37,6 +37,14 @@ in
|
|||
media = mkIpOption;
|
||||
};
|
||||
|
||||
network.dhcpd.blowhole = mkOption {
|
||||
description = ''
|
||||
Secret config specific to blowhole's dhcpcd.
|
||||
'';
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
|
||||
network.networks = {
|
||||
home.inner = mkNetworkOption;
|
||||
home.outer = mkNetworkOption;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ pkgs, secret, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
lan = "enp7s0f0";
|
||||
|
@ -15,7 +15,7 @@ in
|
|||
imports = [
|
||||
(_: {
|
||||
systemd.services =
|
||||
listToAttrs (flip map config.magic_rb.secret.wireguard."${config.networking.hostName}".peers or {}
|
||||
listToAttrs (flip map config.magic_rb.secret.wireguard."${config.networking.hostName}".peers or []
|
||||
(v:
|
||||
let
|
||||
peerUnitServiceName = interfaceName: publicKey: dynamicRefreshEnabled:
|
||||
|
@ -99,16 +99,18 @@ in
|
|||
enable = true;
|
||||
interfaces = [ "${lan}" ];
|
||||
extraConfig = ''
|
||||
option domain-name-servers 10.64.2.1;
|
||||
option subnet-mask 255.255.255.0;
|
||||
option domain-name-servers 10.64.2.1;
|
||||
option subnet-mask 255.255.255.0;
|
||||
|
||||
subnet 10.64.2.0 netmask 255.255.255.0 {
|
||||
option broadcast-address 10.64.2.255;
|
||||
option routers 10.64.2.1;
|
||||
interface ${lan};
|
||||
range 10.64.2.128 10.64.2.254;
|
||||
}
|
||||
'';
|
||||
subnet 10.64.2.0 netmask 255.255.255.0 {
|
||||
option broadcast-address 10.64.2.255;
|
||||
option routers 10.64.2.1;
|
||||
interface ${lan};
|
||||
range 10.64.2.128 10.64.2.254;
|
||||
|
||||
${secret.network.dhcpd.blowhole}
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
# systemd.services.dns-check = {
|
||||
|
|
Loading…
Reference in a new issue