nixos: add services.rsyncd.socketActivated option

Define systemd-socket activation using the upstream configuration
files as a reference. The "rsyncd" systemd unit has been renamed
to "rsync" for consistency with upstream.
This commit is contained in:
Emery Hemingway
2021-01-28 11:22:31 +01:00
parent 750510ee7c
commit f32d7e4e03
2 changed files with 80 additions and 19 deletions
+25 -14
View File
@@ -2,24 +2,35 @@ import ./make-test-python.nix ({ pkgs, ... }: {
name = "rsyncd";
meta.maintainers = with pkgs.lib.maintainers; [ ehmry ];
nodes.machine.services.rsyncd = {
enable = true;
settings = {
global = {
"reverse lookup" = false;
"forward lookup" = false;
nodes = let
mkNode = socketActivated:
{ config, ... }: {
networking.firewall.allowedTCPPorts = [ config.services.rsyncd.port ];
services.rsyncd = {
enable = true;
inherit socketActivated;
settings = {
global = {
"reverse lookup" = false;
"forward lookup" = false;
};
tmp = {
path = "/nix/store";
comment = "test module";
};
};
};
};
tmp = {
path = "/nix/store";
comment = "test module";
};
};
in {
a = mkNode false;
b = mkNode true;
};
testScript = ''
start_all()
machine.wait_for_unit("rsyncd")
machine.succeed("rsync localhost::")
a.wait_for_unit("rsync")
b.wait_for_unit("sockets.target")
b.succeed("rsync a::")
a.succeed("rsync b::")
'';
})