Compare commits

..

No commits in common. "d73b1c5abe2da061aae8d3fdac3829106a8492a1" and "31c2843393f233e7d4f92800a15e750dcd2d4a99" have entirely different histories.

15 changed files with 28 additions and 56 deletions

View file

@ -22,7 +22,6 @@ 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,7 +14,6 @@ in
path0 = "${sopsPath}/${name}"; path0 = "${sopsPath}/${name}";
}; };
ports = { ports = {
port0 = 53; port0 = 51821;
port1 = 51821;
}; };
} }

View file

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

View file

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

View file

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

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

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

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

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

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

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

@ -9,8 +9,7 @@ let
in in
{ {
port = configHelpers.service.ports.port0; port = configHelpers.service.ports.port0;
bind_address = bind_address = ceres.wireguard.ip0;
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 Executable file → Normal file
View file

View file

@ -5,7 +5,7 @@
... ...
}: }:
let let
inherit (flake.config.machines.devices) ceres mars; inherit (flake.config.machines.devices) ceres;
inherit (flake.config.services.instances) searx web; inherit (flake.config.services.instances) searx web;
configHelpers = { configHelpers = {
service = searx; service = searx;
@ -47,9 +47,8 @@ in
"${configHelpers.host}" = { "${configHelpers.host}" = {
extraConfig = '' extraConfig = ''
@allowed_ips { @allowed_ips {
remote_ip ${mars.wireguard.ip0} remote_ip 10.100.0.2
} }
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

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

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

View file

@ -1,27 +1,23 @@
{ config, flake, ... }: { config, flake, ... }:
let let
inherit (flake.config.services.instances) wireGuard web; inherit (flake.config.services.instances) wireGuard web;
inherit (flake.config.services) instances; inherit (flake.config.machines.devices) mars;
inherit (flake.config.machines.devices) ceres mars;
service = wireGuard; service = wireGuard;
in in
{ {
networking = { networking = {
hosts = { wg-quick.interfaces = {
${ceres.wireguard.ip0} = [ instances.searx.domains.url0 ];
};
wireguard.interfaces = {
wg0 = { wg0 = {
ips = [ "${mars.wireguard.ip0}/32" ]; address = [ "${mars.wireguard.ip0}/24" ];
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 = [
"${ceres.wireguard.ip0}/32" "10.100.0.0/24"
"${web.localhost.address4}/24" "192.168.1.0/24"
]; ];
endpoint = "${web.remotehost.address0}:${builtins.toString service.ports.port1}"; endpoint = "${web.remotehost.address0}:${builtins.toString service.ports.port0}";
persistentKeepalive = 25; persistentKeepalive = 25;
} }
]; ];