Compare commits

..

17 commits

Author SHA1 Message Date
Nick
d73b1c5abe feat: wireguard test 2025-07-01 17:13:29 -05:00
Nick
f9e0ffb400 feat: wireguard test 2025-07-01 16:37:21 -05:00
Nick
d7360e2e63 feat: wireguard test 2025-07-01 16:26:05 -05:00
Nick
baa7cfc6f8 feat: wireguard test 2025-07-01 16:23:37 -05:00
Nick
1c4228ad60 feat: wireguard test 2025-07-01 16:20:32 -05:00
Nick
67892565eb feat: wireguard test 2025-07-01 16:17:21 -05:00
Nick
9c69449a55 feat: wireguard test 2025-07-01 16:15:28 -05:00
Nick
1d9097408c feat: wireguard test 2025-07-01 16:08:54 -05:00
Nick
8b9ece1b4e feat: wireguard test 2025-07-01 15:41:16 -05:00
Nick
6fb7b5504d feat: wireguard test 2025-07-01 15:39:57 -05:00
Nick
9c8890926e feat: wireguard test 2025-07-01 14:51:22 -05:00
Nick
c6c3e4b3a4 feat: wireguard test 2025-07-01 14:14:51 -05:00
Nick
c6ea717181 feat: wireguard test 2025-07-01 13:54:00 -05:00
Nick
93366c81c8 feat: wireguard test 2025-07-01 12:49:22 -05:00
Nick
3ffa8c9db0 feat: wireguard test 2025-07-01 12:46:52 -05:00
Nick
f240fddd73 feat: wireguard test 2025-07-01 12:40:17 -05:00
Nick
b04a752443 feat: wireguard test 2025-07-01 12:35:02 -05:00
15 changed files with 57 additions and 29 deletions

View file

@ -22,6 +22,7 @@ in
address1 = "0.0.0.0"; # All address1 = "0.0.0.0"; # All
address2 = "192.168.50.1"; # Router address2 = "192.168.50.1"; # Router
address3 = "192.168.50.0"; # Router address3 = "192.168.50.0"; # Router
address4 = "192.168.1.0"; # Router
}; };
remotehost = { remotehost = {
address0 = "24.76.173.0"; address0 = "24.76.173.0";

View file

@ -14,6 +14,7 @@ in
path0 = "${sopsPath}/${name}"; path0 = "${sopsPath}/${name}";
}; };
ports = { ports = {
port0 = 51821; port0 = 53;
port1 = 51821;
}; };
} }

View file

@ -0,0 +1,11 @@
{
pkgs,
...
}:
{
home.packages = builtins.attrValues {
inherit (pkgs)
dig
;
};
}

View file

@ -0,0 +1,11 @@
{
pkgs,
...
}:
{
home.packages = builtins.attrValues {
inherit (pkgs)
iptables
;
};
}

View file

@ -18,7 +18,6 @@ in
wayland wayland
searx searx
flatpak flatpak
wireGuard
; ;
}; };
}; };
@ -33,7 +32,6 @@ in
sddm sddm
flatpak flatpak
espanso espanso
wireGuard
glance glance
; ;
}; };
@ -44,7 +42,6 @@ in
inherit (modules) inherit (modules)
plasma plasma
sddm sddm
wireGuard
; ;
}; };
}; };
@ -70,15 +67,6 @@ in
}; };
}; };
mantle = {
imports = builtins.attrValues {
inherit (modules)
sops
xserver
;
};
};
crust = { crust = {
imports = builtins.attrValues { imports = builtins.attrValues {
inherit (modules) inherit (modules)
@ -88,6 +76,15 @@ in
}; };
}; };
mantle = {
imports = builtins.attrValues {
inherit (modules)
sops
xserver
;
};
};
core = { core = {
imports = builtins.attrValues { imports = builtins.attrValues {
inherit (modules) inherit (modules)

0
modules/nixos/services/searx/config/engines.nix Normal file → Executable file
View file

0
modules/nixos/services/searx/config/general.nix Normal file → Executable file
View file

0
modules/nixos/services/searx/config/outgoing.nix Normal file → Executable file
View file

0
modules/nixos/services/searx/config/plugins.nix Normal file → Executable file
View file

0
modules/nixos/services/searx/config/search.nix Normal file → Executable file
View file

3
modules/nixos/services/searx/config/server.nix Normal file → Executable file
View file

@ -9,7 +9,8 @@ let
in in
{ {
port = configHelpers.service.ports.port0; port = configHelpers.service.ports.port0;
bind_address = ceres.wireguard.ip0; bind_address =
if configHelpers.hostname == ceres.name then ceres.wireguard.ip0 else configHelpers.localhost;
secret_key = config.sops.secrets.searx-key.path; secret_key = config.sops.secrets.searx-key.path;
limiter = false; limiter = false;
public_instance = false; public_instance = false;

0
modules/nixos/services/searx/config/ui.nix Normal file → Executable file
View file

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (flake.config.machines.devices) ceres; inherit (flake.config.machines.devices) ceres mars;
inherit (flake.config.services.instances) searx web; inherit (flake.config.services.instances) searx web;
configHelpers = { configHelpers = {
service = searx; service = searx;
@ -47,8 +47,9 @@ in
"${configHelpers.host}" = { "${configHelpers.host}" = {
extraConfig = '' extraConfig = ''
@allowed_ips { @allowed_ips {
remote_ip 10.100.0.2 remote_ip ${mars.wireguard.ip0}
} }
handle @allowed_ips { handle @allowed_ips {
redir /.well-known/carddav /remote.php/dav/ 301 redir /.well-known/carddav /remote.php/dav/ 301
redir /.well-known/caldav /remote.php/dav/ 301 redir /.well-known/caldav /remote.php/dav/ 301

15
systems/ceres/config/wireguard.nix Normal file → Executable file
View file

@ -1,20 +1,21 @@
{ config, flake, ... }: { config, flake, ... }:
let let
inherit (flake.config.services.instances) wireGuard web; inherit (flake.config.services.instances) wireGuard searx;
inherit (flake.config.machines.devices) mars ceres; inherit (flake.config.machines.devices) mars ceres;
service = wireGuard; service = wireGuard;
in in
{ {
networking = { networking = {
firewall = { firewall = {
allowedUDPPorts = [ allowedTCPPorts = [
53
service.ports.port0 service.ports.port0
]; ];
allowedUDPPorts = [
service.ports.port0
service.ports.port1
];
interfaces.wg0.allowedTCPPorts = [ interfaces.wg0.allowedTCPPorts = [
80 searx.ports.port0
443
8080
]; ];
}; };
@ -28,7 +29,7 @@ in
wireguard.interfaces = { wireguard.interfaces = {
wg0 = { wg0 = {
ips = [ "${ceres.wireguard.ip0}/24" ]; ips = [ "${ceres.wireguard.ip0}/24" ];
listenPort = service.ports.port0; listenPort = service.ports.port1;
privateKeyFile = config.sops.secrets."${service.name}-private".path; privateKeyFile = config.sops.secrets."${service.name}-private".path;
peers = [ peers = [
{ {

View file

@ -1,23 +1,27 @@
{ config, flake, ... }: { config, flake, ... }:
let let
inherit (flake.config.services.instances) wireGuard web; inherit (flake.config.services.instances) wireGuard web;
inherit (flake.config.machines.devices) mars; inherit (flake.config.services) instances;
inherit (flake.config.machines.devices) ceres mars;
service = wireGuard; service = wireGuard;
in in
{ {
networking = { networking = {
wg-quick.interfaces = { hosts = {
${ceres.wireguard.ip0} = [ instances.searx.domains.url0 ];
};
wireguard.interfaces = {
wg0 = { wg0 = {
address = [ "${mars.wireguard.ip0}/24" ]; ips = [ "${mars.wireguard.ip0}/32" ];
privateKeyFile = config.sops.secrets."${service.name}-mars-private".path; privateKeyFile = config.sops.secrets."${service.name}-mars-private".path;
peers = [ peers = [
{ {
publicKey = "fs58+Kz+eG9qAXvvMB2NkW+wa88yP61uam4HHWaBJVw="; publicKey = "fs58+Kz+eG9qAXvvMB2NkW+wa88yP61uam4HHWaBJVw=";
allowedIPs = [ allowedIPs = [
"10.100.0.0/24" "${ceres.wireguard.ip0}/32"
"192.168.1.0/24" "${web.localhost.address4}/24"
]; ];
endpoint = "${web.remotehost.address0}:${builtins.toString service.ports.port0}"; endpoint = "${web.remotehost.address0}:${builtins.toString service.ports.port1}";
persistentKeepalive = 25; persistentKeepalive = 25;
} }
]; ];