about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-06-08 15:01:32 +0300
committerFlorian Klink <flokli@flokli.de>2024-06-08 15:01:32 +0300
commit6a3a382d5bdc2a0cef131f5244dd37e447ad609e (patch)
tree24c33cc4b760f102b04d1906bda90b0c5f37cec6 /nixos
parent9a4cd7ce4ec2f0dac80c2be3033e897894709def (diff)
nixos/mycelium: add mycelium binary to systemPackages
It's now possible to invoke `mycelium {routes,peers} list`.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/mycelium.nix2
-rw-r--r--nixos/tests/mycelium/default.nix3
2 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/mycelium.nix b/nixos/modules/services/networking/mycelium.nix
index 9487a5daafee0..0d0b2945af4c1 100644
--- a/nixos/modules/services/networking/mycelium.nix
+++ b/nixos/modules/services/networking/mycelium.nix
@@ -60,6 +60,8 @@ in
     networking.firewall.allowedTCPPorts = lib.optionals cfg.openFirewall [ 9651 ];
     networking.firewall.allowedUDPPorts = lib.optionals cfg.openFirewall [ 9650 9651 ];
 
+    environment.systemPackages = [ cfg.package ];
+
     systemd.services.mycelium = {
       description = "Mycelium network";
       after = [ "network.target" ];
diff --git a/nixos/tests/mycelium/default.nix b/nixos/tests/mycelium/default.nix
index 9174c49d70869..956a822a21860 100644
--- a/nixos/tests/mycelium/default.nix
+++ b/nixos/tests/mycelium/default.nix
@@ -51,6 +51,9 @@ in
       peer1.wait_for_unit("mycelium.service")
       peer2.wait_for_unit("mycelium.service")
 
+      peer1.succeed("mycelium peers list | grep 192.168.1.12")
+      peer2.succeed("mycelium peers list | grep 192.168.1.11")
+
       peer1.succeed("ping -c5 ${peer2-ip}")
       peer2.succeed("ping -c5 ${peer1-ip}")
     '';