diff --git a/devices/cluster/default.nix b/devices/cluster/default.nix index 08d6578..d947f32 100644 --- a/devices/cluster/default.nix +++ b/devices/cluster/default.nix @@ -1,7 +1,7 @@ deviceName: {config, ...}: let inherit (config.vars) mainUser hostName; - clusterIP = config.services.pacemaker.virtualIps.caddy-vip.ip; + clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; in { imports = [ ./hardware-configuration.nix @@ -10,7 +10,7 @@ in { ../../modules/sshd.nix ../../modules/tailscale.nix - ./modules/pacemaker.nix + ./modules/pcsd.nix ]; vars = { diff --git a/devices/cluster/modules/caddy.nix b/devices/cluster/modules/caddy.nix index 72b9511..e1100ed 100644 --- a/devices/cluster/modules/caddy.nix +++ b/devices/cluster/modules/caddy.nix @@ -9,7 +9,7 @@ caddy = caddy-plugins.packages.${pkgs.system}.default; - clusterIP = config.services.pacemaker.virtualIps.caddy-vip.ip; + clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; in { imports = [caddy-plugins.nixosModules.default]; diff --git a/devices/cluster/modules/headscale/default.nix b/devices/cluster/modules/headscale/default.nix index 1091d61..956354e 100644 --- a/devices/cluster/modules/headscale/default.nix +++ b/devices/cluster/modules/headscale/default.nix @@ -9,7 +9,7 @@ inherit (config.vars) mainUser hostName; headscale-flake = headscale.packages.${pkgs.system}.headscale; - clusterIP = config.services.pacemaker.virtualIps.caddy-vip.ip; + clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; in { environment.systemPackages = [headscale-flake]; users.users.${mainUser}.extraGroups = ["headscale"]; diff --git a/devices/cluster/modules/pacemaker.nix b/devices/cluster/modules/pcsd.nix similarity index 82% rename from devices/cluster/modules/pacemaker.nix rename to devices/cluster/modules/pcsd.nix index d64c06c..b9161bd 100644 --- a/devices/cluster/modules/pacemaker.nix +++ b/devices/cluster/modules/pcsd.nix @@ -1,12 +1,12 @@ { config, - pacemaker, + pcsd, ... }: let inherit (config.sops) secrets; in { imports = [ - pacemaker.nixosModules.default + pcsd.nixosModules.default ./blocky.nix ./caddy.nix @@ -15,7 +15,7 @@ in { ./unbound.nix ]; - services.pacemaker = { + services.pcsd = { enable = true; clusterName = "thingies"; @@ -58,14 +58,18 @@ in { nodes = [ { - nodeid = 1; name = "thingone"; - ring_addrs = ["10.0.0.244"]; + nodeid = "1"; + addrs = [ + {addr = "10.0.0.244";} + ]; } { - nodeid = 2; name = "thingtwo"; - ring_addrs = ["10.0.0.159"]; + nodeid = "2"; + addrs = [ + {addr = "10.0.0.159";} + ]; } ]; }; diff --git a/flake.lock b/flake.lock index 5bf1412..5e95bdc 100644 --- a/flake.lock +++ b/flake.lock @@ -948,6 +948,7 @@ "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", + "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", "type": "github" } }, @@ -1068,25 +1069,6 @@ "type": "github" } }, - "pacemaker": { - "inputs": { - "nixpkgs": "nixpkgs_8", - "nixpkgs-pacemaker": "nixpkgs-pacemaker" - }, - "locked": { - "lastModified": 1706586193, - "narHash": "sha256-TxBiyKYsIxQY6zZZb3XcZ9tF8BupRJwMpoCjyJVCxQc=", - "owner": "matt1432", - "repo": "nixos-pacemaker", - "rev": "fe7e11faaa4cc81e1e71c7865520bc7a53329508", - "type": "github" - }, - "original": { - "owner": "matt1432", - "repo": "nixos-pacemaker", - "type": "github" - } - }, "pam-fprint-grosshack-src": { "flake": false, "locked": { @@ -1103,6 +1085,25 @@ "type": "gitlab" } }, + "pcsd": { + "inputs": { + "nixpkgs": "nixpkgs_8", + "nixpkgs-pacemaker": "nixpkgs-pacemaker" + }, + "locked": { + "lastModified": 1706805944, + "narHash": "sha256-LEDTPr4QJohJGQQKPNyb+hDmPGN3pZBmSkItepStxCs=", + "owner": "matt1432", + "repo": "nixos-pcsd", + "rev": "0b9b8e37c0ad404d0d5bf24333b8df420d16dcf2", + "type": "github" + }, + "original": { + "owner": "matt1432", + "repo": "nixos-pcsd", + "type": "github" + } + }, "persist-properties-src": { "flake": false, "locked": { @@ -1213,8 +1214,8 @@ "nur": "nur", "nurl": "nurl", "nvim-theme-src": "nvim-theme-src", - "pacemaker": "pacemaker", "pam-fprint-grosshack-src": "pam-fprint-grosshack-src", + "pcsd": "pcsd", "persist-properties-src": "persist-properties-src", "plymouth-src": "plymouth-src", "plymouth-theme-src": "plymouth-theme-src", diff --git a/flake.nix b/flake.nix index b169906..8e22597 100644 --- a/flake.nix +++ b/flake.nix @@ -141,10 +141,10 @@ }; # Cluster Inputs - pacemaker = { + pcsd = { type = "github"; owner = "matt1432"; - repo = "nixos-pacemaker"; + repo = "nixos-pcsd"; # FIXME: OCF resources break on latest # inputs.nixpkgs.follows = "nixpkgs";