diff --git a/nixosConfigurations/muede-lpt2/default.nix b/nixosConfigurations/muede-lpt2/default.nix index ae0591d..c62e807 100644 --- a/nixosConfigurations/muede-lpt2/default.nix +++ b/nixosConfigurations/muede-lpt2/default.nix @@ -1,9 +1,8 @@ -{ self, pkgs, ... }: +{ pkgs, ... }: { imports = [ ./containers.nix ./hardware.nix - ./hyperhive.nix ]; config = { @@ -59,5 +58,10 @@ ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + + my.constellation-swarm = { + enable = true; + hiveName = "pr1ma"; + }; }; } diff --git a/nixosConfigurations/muede-pc2/default.nix b/nixosConfigurations/muede-pc2/default.nix index ff00c41..c4a3fba 100644 --- a/nixosConfigurations/muede-pc2/default.nix +++ b/nixosConfigurations/muede-pc2/default.nix @@ -2,9 +2,8 @@ { imports = [ ./hardware.nix - # ./vscode-server.nix - # ./hass.nix - ./hyperhive.nix + # ./vscode-server.nix + # ./hass.nix ]; config = { @@ -47,5 +46,10 @@ # Factorio 34197 ]; + + my.constellation-swarm = { + enable = true; + hiveName = "umbra"; + }; }; } diff --git a/nixosConfigurations/muede-pc2/hyperhive.nix b/nixosConfigurations/muede-pc2/hyperhive.nix deleted file mode 100644 index d31287a..0000000 --- a/nixosConfigurations/muede-pc2/hyperhive.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ hyperhive, ... }: -{ - imports = [ hyperhive.nixosModules.default ]; - - config.services.hyperhive = { - enable = true; - domain = "umbra.darkest.space"; - hiveName = "umbra"; - swarmName = "constellation"; - matrix = { - enable = true; - gui.enable = true; - }; - forge.ci.enable = true; - gateway = { - localHostsEntry = true; - openFirewall = true; - }; - swarm.peers = { - "pr1ma.darkest.space" = { - certFingerprint = "sha256:63e026f8682d6b5496f3eec99edb2ef62a8999c6d767228051e6e057f8cd90c6"; - }; - }; - }; -} diff --git a/nixosConfigurations/muede-lpt2/hyperhive.nix b/nixosModules/constellation-swarm.nix similarity index 50% rename from nixosConfigurations/muede-lpt2/hyperhive.nix rename to nixosModules/constellation-swarm.nix index 049d127..9e293d8 100644 --- a/nixosConfigurations/muede-lpt2/hyperhive.nix +++ b/nixosModules/constellation-swarm.nix @@ -1,18 +1,27 @@ -{ hyperhive, ... }: { + hyperhive, + lib, + config, + ... +}: +let + cfg = config.my.constellation-swarm; +in +{ + options.my.constellation-swarm = { + enable = lib.mkEnableOption "hyperhive / constellation swarm"; + hive-name = lib.mkOption { type = lib.types.str; }; + }; + imports = [ hyperhive.nixosModules.default ]; - config.services.hyperhive = { + config.services.hyperhive = lib.mkIf cfg.enable { enable = true; - domain = "pr1ma.darkest.space"; - hiveName = "pr1ma"; swarmName = "constellation"; ruthless = true; - matrix = { - enable = true; - gui.enable = true; - serverName = "pr1ma.darkest.space"; - }; + domain = "${cfg.hive-name}.darkest.space"; + hiveName = cfg.hive-name; + matrix.enable = true; forge.ci.enable = true; gateway = { localHostsEntry = true; @@ -22,6 +31,9 @@ "umbra.darkest.space" = { certFingerprint = "sha256:ae68d089e0155978fff7a9963bfb1e123ed645e7c9f93a4b4bb3e278c5f32a27"; }; + "pr1ma.darkest.space" = { + certFingerprint = "sha256:63e026f8682d6b5496f3eec99edb2ef62a8999c6d767228051e6e057f8cd90c6"; + }; }; otel = { enable = true;