networking lambdas to enable wakeonlan and hosts file
This commit is contained in:
parent
8a46014a08
commit
47f4b2a536
@ -49,6 +49,15 @@ in
|
|||||||
};
|
};
|
||||||
description = "Set of IP's for all my computers.";
|
description = "Set of IP's for all my computers.";
|
||||||
};
|
};
|
||||||
|
interfaces = lib.mkOption {
|
||||||
|
type = lib.types.attrsOf lib.types.str;
|
||||||
|
default = {
|
||||||
|
server = "enp0s31f6";
|
||||||
|
miniserver = "enp2s0";
|
||||||
|
workstation = "enp5s0";
|
||||||
|
};
|
||||||
|
description = "Set of network interface names for all my computers.";
|
||||||
|
};
|
||||||
mainServer = lib.mkOption {
|
mainServer = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "miniserver";
|
default = "miniserver";
|
||||||
|
|||||||
@ -154,7 +154,7 @@ in
|
|||||||
log_type = "file";
|
log_type = "file";
|
||||||
loglevel = 1;
|
loglevel = 1;
|
||||||
trusted_domains = [
|
trusted_domains = [
|
||||||
config.my.ips.miniserver
|
config.my.ips.${config.networking.hostName}
|
||||||
"localhost"
|
"localhost"
|
||||||
"cloud.rotehaare.art"
|
"cloud.rotehaare.art"
|
||||||
"cloud.servidos.lat"
|
"cloud.servidos.lat"
|
||||||
|
|||||||
@ -10,11 +10,8 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
dns = "none";
|
dns = "none";
|
||||||
};
|
};
|
||||||
hosts = {
|
hosts = config.my.ips |> lib.mapAttrs' (hostname: ip: lib.nameValuePair ip [ hostname ]);
|
||||||
"192.168.1.64" = [ "workstation" ];
|
interfaces."${config.my.interfaces.${config.networking.hostName}}".wakeOnLan.enable = true;
|
||||||
"192.168.1.69" = [ "server" ];
|
|
||||||
"192.168.1.100" = [ "miniserver" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
services.dnscrypt-proxy2 = {
|
services.dnscrypt-proxy2 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ in
|
|||||||
firewall.allowedUDPPorts = [ port ];
|
firewall.allowedUDPPorts = [ port ];
|
||||||
nat = {
|
nat = {
|
||||||
enable = true;
|
enable = true;
|
||||||
externalInterface = "enp2s0";
|
externalInterface = config.my.interfaces.${config.hostName};
|
||||||
internalInterfaces = [ "wg0" ];
|
internalInterfaces = [ "wg0" ];
|
||||||
};
|
};
|
||||||
wireguard.interfaces.wg0 = {
|
wireguard.interfaces.wg0 = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user