diff --git a/configurations/cluster/default.nix b/configurations/cluster/default.nix index 8a7d4eaf..086da208 100644 --- a/configurations/cluster/default.nix +++ b/configurations/cluster/default.nix @@ -4,7 +4,7 @@ deviceName: { self, ... }: let - clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; + clusterIP = (builtins.head config.services.pcsd.virtualIps).ip; in { # ------------------------------------------------ # Imports diff --git a/configurations/cluster/modules/caddy/default.nix b/configurations/cluster/modules/caddy/default.nix index b7618109..19604be1 100644 --- a/configurations/cluster/modules/caddy/default.nix +++ b/configurations/cluster/modules/caddy/default.nix @@ -6,7 +6,7 @@ self, ... }: let - inherit (lib) attrValues removeAttrs; + inherit (lib) attrValues head removeAttrs; inherit (config.sops) secrets; inherit (config.networking) hostName; @@ -34,7 +34,7 @@ in { }; virtualHosts = let - clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; + clusterIP = (head config.services.pcsd.virtualIps).ip; nosIP = "10.0.0.121"; serviviIP = "10.0.0.249"; homieIP = "100.64.0.10"; diff --git a/configurations/cluster/modules/headscale/default.nix b/configurations/cluster/modules/headscale/default.nix index 72b76e95..079bee36 100644 --- a/configurations/cluster/modules/headscale/default.nix +++ b/configurations/cluster/modules/headscale/default.nix @@ -5,7 +5,7 @@ }: let inherit (config.networking) hostName; - clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; + clusterIP = (builtins.head config.services.pcsd.virtualIps).ip; in { users.users.${mainUser}.extraGroups = ["headscale"]; diff --git a/configurations/cluster/modules/pcsd/default.nix b/configurations/cluster/modules/pcsd/default.nix index 455f355b..dd262eaf 100644 --- a/configurations/cluster/modules/pcsd/default.nix +++ b/configurations/cluster/modules/pcsd/default.nix @@ -16,45 +16,46 @@ in { corosyncKeyFile = secrets.corosync.path; clusterUserPasswordFile = secrets.pcs-pass.path; - virtualIps = { - "caddy-vip" = { + virtualIps = [ + { + id = "caddy-vip"; ip = "10.0.0.130"; interface = "eno1"; group = "caddy-grp"; - }; - }; + } + ]; - systemdResources = { - "unbound" = { + systemdResources = [ + { + systemdName = "unbound"; enable = true; group = "caddy-grp"; - startAfter = ["caddy-vip"]; - }; + } - "blocky" = { + { + systemdName = "blocky"; enable = true; group = "caddy-grp"; - startAfter = ["unbound"]; - }; + } - "headscale" = { + { + systemdName = "headscale"; enable = true; group = "caddy-grp"; - startAfter = ["blocky"]; - }; + } - "caddy" = { + { + systemdName = "caddy"; enable = true; group = "caddy-grp"; - startAfter = ["headscale"]; - }; + } - "searx" = { + { + systemdName = "searx"; enable = true; group = "caddy-grp"; - startAfter = ["caddy"]; - }; - }; + } + ]; nodes = [ { diff --git a/configurations/cluster/modules/searxng/default.nix b/configurations/cluster/modules/searxng/default.nix index b62b87b9..9b9b6e4f 100644 --- a/configurations/cluster/modules/searxng/default.nix +++ b/configurations/cluster/modules/searxng/default.nix @@ -4,7 +4,7 @@ pkgs, ... }: let - inherit (lib) mapAttrsToList; + inherit (lib) head mapAttrsToList; in { services.searx = { enable = true; @@ -43,7 +43,7 @@ in { server = { port = 8080; - bind_address = config.services.pcsd.virtualIps.caddy-vip.ip; + bind_address = (head config.services.pcsd.virtualIps).ip; secret_key = "@SEARXNG_SECRET@"; diff --git a/flake.lock b/flake.lock index 3dbf03b7..a630a3ae 100644 Binary files a/flake.lock and b/flake.lock differ diff --git a/flake.nix b/flake.nix index 79d5e922..7a7e9a9f 100644 Binary files a/flake.nix and b/flake.nix differ