Added Fixed Wireguard ips to hosts dns lookup
This commit is contained in:
+17
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
pkgs,
|
||||
primaryUser,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -51,6 +52,12 @@
|
||||
info.enable = false; # Skip info pages
|
||||
};
|
||||
|
||||
# Mirrored Network conf
|
||||
networking.knownNetworkServices = [
|
||||
"Wi-Fi"
|
||||
"Ethernet"
|
||||
];
|
||||
|
||||
# homebrew installation manager
|
||||
nix-homebrew = {
|
||||
user = primaryUser;
|
||||
@@ -60,15 +67,24 @@
|
||||
|
||||
# macOS-specific settings
|
||||
programs.fish.enable = true;
|
||||
environment.shells = [ pkgs.fish ];
|
||||
system.primaryUser = primaryUser;
|
||||
users.users.${primaryUser} = {
|
||||
home = "/Users/${primaryUser}";
|
||||
shell = pkgs.fish;
|
||||
openssh.authorizedKeys.keyFiles = [ ../secrets/ssh-key ];
|
||||
};
|
||||
|
||||
environment = {
|
||||
shells = [ pkgs.fish ];
|
||||
systemPath = [ "/opt/homebrew/bin" ];
|
||||
pathsToLink = [ "/Applications" ];
|
||||
etc."hosts".text = lib.mkAfter ''
|
||||
10.10.0.1 proxy.cyperpunk.de
|
||||
10.10.0.2 controller.cyperpunk.de
|
||||
10.10.0.3 mac.cyperpunk.de
|
||||
10.10.0.30 node1.cyperpunk.de
|
||||
10.10.0.31 node2.cyperpunk.de
|
||||
10.10.0.40 desktop.cyperpunk.de
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
...
|
||||
}:
|
||||
{
|
||||
sops.secrets."wireguard/${hostName}" = {
|
||||
sops.secrets."network/wireguard/${hostName}" = {
|
||||
mode = "0400";
|
||||
};
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
script = ''
|
||||
set -e
|
||||
mkdir -p /etc/wireguard
|
||||
PRIVATE_KEY=$(cat ${config.sops.secrets."wireguard/${hostName}".path})
|
||||
PRIVATE_KEY=$(cat ${config.sops.secrets."network/wireguard/${hostName}".path})
|
||||
cat > /etc/wireguard/wg0.conf << EOF
|
||||
[Interface]
|
||||
Address = $WG_IP
|
||||
|
||||
Generated
+3
-3
@@ -57,11 +57,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1781255309,
|
||||
"narHash": "sha256-n2P5xkAYGylrJ3feu7L6uaCUw/+jW8rk+HO127gDbFA=",
|
||||
"lastModified": 1782648384,
|
||||
"narHash": "sha256-OlHdAqdXasZk1U+Zf9n+ivqHL9kj/UD0DFO4yYTNBYc=",
|
||||
"owner": "catppuccin",
|
||||
"repo": "nix",
|
||||
"rev": "036c78ea4cd8a42c8546c6316a944fd7d59d4341",
|
||||
"rev": "f2c7dd14ecce785c206a39466cbe227ff62e3803",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
+14
-4
@@ -130,10 +130,20 @@
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
9002
|
||||
3100
|
||||
];
|
||||
networking = {
|
||||
hosts = {
|
||||
"10.10.0.1" = [ "proxy.cyperpunk.de" ];
|
||||
"10.10.0.2" = [ "controller.cyperpunk.de" ];
|
||||
"10.10.0.3" = [ "mac.cyperpunk.de" ];
|
||||
"10.10.0.30" = [ "node1.cyperpunk.de" ];
|
||||
"10.10.0.31" = [ "node2.cyperpunk.de" ];
|
||||
"10.10.0.40" = [ "desktop.cyperpunk.de" ];
|
||||
};
|
||||
firewall.allowedTCPPorts = [
|
||||
9002
|
||||
3100
|
||||
];
|
||||
};
|
||||
|
||||
users.users.${primaryUser} = {
|
||||
home = "/home/${primaryUser}";
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
{ config, hostName, ... }:
|
||||
{
|
||||
sops.secrets."wireguard/${hostName}" = {
|
||||
sops.secrets."network/wireguard/${hostName}" = {
|
||||
mode = "0400";
|
||||
};
|
||||
|
||||
networking = {
|
||||
wireguard.interfaces.wg0 = {
|
||||
privateKeyFile = config.sops.secrets."wireguard/${hostName}".path;
|
||||
privateKeyFile = config.sops.secrets."network/wireguard/${hostName}".path;
|
||||
};
|
||||
firewall.allowedUDPPorts = [ 51820 ];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user