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
address2 = "192.168.50.1"; # Router
address3 = "192.168.50.0"; # Router
address4 = "192.168.1.0"; # Router
};
remotehost = {
address0 = "24.76.173.0";

View file

@ -14,6 +14,7 @@ in
path0 = "${sopsPath}/${name}";
};
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
searx
flatpak
wireGuard
;
};
};
@ -33,7 +32,6 @@ in
sddm
flatpak
espanso
wireGuard
glance
;
};
@ -44,7 +42,6 @@ in
inherit (modules)
plasma
sddm
wireGuard
;
};
};
@ -70,15 +67,6 @@ in
};
};
mantle = {
imports = builtins.attrValues {
inherit (modules)
sops
xserver
;
};
};
crust = {
imports = builtins.attrValues {
inherit (modules)
@ -88,6 +76,15 @@ in
};
};
mantle = {
imports = builtins.attrValues {
inherit (modules)
sops
xserver
;
};
};
core = {
imports = builtins.attrValues {
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
{
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;
limiter = 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
inherit (flake.config.machines.devices) ceres;
inherit (flake.config.machines.devices) ceres mars;
inherit (flake.config.services.instances) searx web;
configHelpers = {
service = searx;
@ -47,8 +47,9 @@ in
"${configHelpers.host}" = {
extraConfig = ''
@allowed_ips {
remote_ip 10.100.0.2
remote_ip ${mars.wireguard.ip0}
}
handle @allowed_ips {
redir /.well-known/carddav /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, ... }:
let
inherit (flake.config.services.instances) wireGuard web;
inherit (flake.config.services.instances) wireGuard searx;
inherit (flake.config.machines.devices) mars ceres;
service = wireGuard;
in
{
networking = {
firewall = {
allowedUDPPorts = [
53
allowedTCPPorts = [
service.ports.port0
];
allowedUDPPorts = [
service.ports.port0
service.ports.port1
];
interfaces.wg0.allowedTCPPorts = [
80
443
8080
searx.ports.port0
];
};
@ -28,7 +29,7 @@ in
wireguard.interfaces = {
wg0 = {
ips = [ "${ceres.wireguard.ip0}/24" ];
listenPort = service.ports.port0;
listenPort = service.ports.port1;
privateKeyFile = config.sops.secrets."${service.name}-private".path;
peers = [
{

View file

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