diff --git a/nixos/modules/private-storage.nix b/nixos/modules/private-storage.nix index c8258769f0f4ceb4bb2067b1bc241e6b8188fe0e..eab06650e5ae91dc6f2a992efbeec6615cdbfa85 100644 --- a/nixos/modules/private-storage.nix +++ b/nixos/modules/private-storage.nix @@ -35,11 +35,13 @@ in }; }; config = lib.mkIf cfg.enable - { services.tahoe.nodes."alpha" = + { services.tahoe.nodes."storage" = { package = config.services.private-storage.tahoe.package; sections = { node = - { nickname = "alpha"; + # XXX Should try to name that is unique across the grid. + { nickname = "storage"; + web.port = "tcp:3456:interface=127.0.0.1"; }; storage = { enabled = true; diff --git a/nixos/modules/tests/private-storage.nix b/nixos/modules/tests/private-storage.nix new file mode 100644 index 0000000000000000000000000000000000000000..048646a1f06d33904f6b2543558e2d08df3ea43a --- /dev/null +++ b/nixos/modules/tests/private-storage.nix @@ -0,0 +1,20 @@ +# https://nixos.org/nixos/manual/index.html#sec-nixos-tests +import <nixpkgs/nixos/tests/make-test.nix> { + + # Configure a single machine as a PrivateStorage storage node. + machine = + { config, pkgs, ... }: + { imports = + [ ../private-storage.nix + ]; + services.private-storage.enable = true; + }; + + # Test the machine with a Perl program (sobbing). + testScript = + '' + $machine->start; + $machine->waitForUnit("tahoe.storage.service"); + $machine->succeed("tahoe -d /var/db/tahoe-lafs/storage status"); + ''; +}