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