diff --git a/config/RemoteBuild.nix b/config/RemoteBuild.nix index de228d5..1861e1d 100644 --- a/config/RemoteBuild.nix +++ b/config/RemoteBuild.nix @@ -89,7 +89,7 @@ in }; services.openssh.knownHosts.nixbuilder = { publicKey = serverSshPublicKey; - extraHostNames = [ "[fd09:8d46:b26:0:8079:82ff:fe1a:916a]:22143" ]; + extraHostNames = [ "[${config.module.const.home}]:22143" ]; }; }) ]; diff --git a/home/file/ssh/config b/home/file/ssh/config index ccf76b6..fa4a503 100644 --- a/home/file/ssh/config +++ b/home/file/ssh/config @@ -4,7 +4,7 @@ Host * ControlPersist yes Host dasha - HostName dasha.local + HostName fd09:8d46:b26:0:29b3:d9b5:d1e9:220f User root Port 22143 diff --git a/host/x86_64-linux/dasha/Network.nix b/host/x86_64-linux/dasha/Network.nix index 77d1e5a..a25571d 100644 --- a/host/x86_64-linux/dasha/Network.nix +++ b/host/x86_64-linux/dasha/Network.nix @@ -1,9 +1,9 @@ -{ ... }: +{ config, ... }: { networking = { firewall.extraCommands = '' # Local access. - ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 + ip6tables -I INPUT -j ACCEPT -s ${config.module.const.ula} ''; }; } diff --git a/host/x86_64-linux/desktop/Network.nix b/host/x86_64-linux/desktop/Network.nix index 77d1e5a..a25571d 100644 --- a/host/x86_64-linux/desktop/Network.nix +++ b/host/x86_64-linux/desktop/Network.nix @@ -1,9 +1,9 @@ -{ ... }: +{ config, ... }: { networking = { firewall.extraCommands = '' # Local access. - ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 + ip6tables -I INPUT -j ACCEPT -s ${config.module.const.ula} ''; }; } diff --git a/host/x86_64-linux/home/Blocky.nix b/host/x86_64-linux/home/Blocky.nix index 6a60993..53efe0a 100644 --- a/host/x86_64-linux/home/Blocky.nix +++ b/host/x86_64-linux/home/Blocky.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, ... }: { services.blocky = { enable = true; @@ -84,10 +84,10 @@ }; customDNS.mapping = let - block = host: { ${host} = "0.0.0.0"; }; + block = host: { ${host} = "0.0.0.0,::"; }; in { - "voronind.com" = "10.0.0.1,fd09:8d46:b26:0:8079:82ff:fe1a:916a"; + "voronind.com" = "10.0.0.1,${config.module.const.home}"; "dasha.local" = "fd09:8d46:b26:0:29b3:d9b5:d1e9:220f"; "desktop.local" = "fd09:8d46:b26:0:2ef8:c58a:c1ac:6cd8"; "home.local" = "fd09:8d46:b26:0:8079:82ff:fe1a:916a"; diff --git a/host/x86_64-linux/home/Const.nix b/host/x86_64-linux/home/Const.nix index 717bcab..108cdbe 100644 --- a/host/x86_64-linux/home/Const.nix +++ b/host/x86_64-linux/home/Const.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, ... }: { config.module.const.host = { data = "/storage/hot_2/data"; @@ -12,7 +12,7 @@ sslCertificateKey = "/etc/letsencrypt/live/voronind.com/privkey.pem"; allowLocal = '' allow 10.0.0.0/8; - allow fd09:8d46:b26::/48; + allow ${config.module.const.ula}; allow 127.0.0.1/32; allow ::1/128; deny all; diff --git a/host/x86_64-linux/home/Network.nix b/host/x86_64-linux/home/Network.nix index 45e7582..7413396 100644 --- a/host/x86_64-linux/home/Network.nix +++ b/host/x86_64-linux/home/Network.nix @@ -9,7 +9,7 @@ }: let internal = "10.0.0.1"; # Lan host IP address. - internal6 = "fd09:8d46:b26:0:8079:82ff:fe1a:916a"; # Lan host IP6 address. + internal6 = config.module.const.home; # Lan host IP6 address. lan = "br0"; # Lan interface. wan = "enp8s0"; # Wan interface. diff --git a/host/x86_64-linux/max/Network.nix b/host/x86_64-linux/max/Network.nix index 77d1e5a..a25571d 100644 --- a/host/x86_64-linux/max/Network.nix +++ b/host/x86_64-linux/max/Network.nix @@ -1,9 +1,9 @@ -{ ... }: +{ config, ... }: { networking = { firewall.extraCommands = '' # Local access. - ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 + ip6tables -I INPUT -j ACCEPT -s ${config.module.const.ula} ''; }; } diff --git a/host/x86_64-linux/msi/Network.nix b/host/x86_64-linux/msi/Network.nix index 77d1e5a..a25571d 100644 --- a/host/x86_64-linux/msi/Network.nix +++ b/host/x86_64-linux/msi/Network.nix @@ -1,9 +1,9 @@ -{ ... }: +{ config, ... }: { networking = { firewall.extraCommands = '' # Local access. - ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 + ip6tables -I INPUT -j ACCEPT -s ${config.module.const.ula} ''; }; } diff --git a/host/x86_64-linux/thinkpad/Network.nix b/host/x86_64-linux/thinkpad/Network.nix index 77d1e5a..a25571d 100644 --- a/host/x86_64-linux/thinkpad/Network.nix +++ b/host/x86_64-linux/thinkpad/Network.nix @@ -1,9 +1,9 @@ -{ ... }: +{ config, ... }: { networking = { firewall.extraCommands = '' # Local access. - ip6tables -I INPUT -j ACCEPT -s fd09:8d46:0b26::/48 + ip6tables -I INPUT -j ACCEPT -s ${config.module.const.ula} ''; }; } diff --git a/option/Const.nix b/option/Const.nix index 6449ba2..6aeea1e 100644 --- a/option/Const.nix +++ b/option/Const.nix @@ -17,6 +17,14 @@ default = "https://git.voronind.com/voronind/nix.git"; type = lib.types.str; }; + home = lib.mkOption { + default = "fd09:8d46:b26:0:8079:82ff:fe1a:916a"; + type = lib.types.str; + }; + ula = lib.mkOption { + default = "fd09:8d46:b26::/48"; + type = lib.types.str; + }; host = lib.mkOption { default = { }; type = lib.types.attrs;