NixOS/nixpkgs — pull request #5254 by ehmry (2014-12-07 20:58:27+00:00)
Title: nixos: configure samba and rsync shares with sets

First let me point out that the following snippet has the same meaning in Samba, Rsync, and Netatalk config files:
```
[srv]
path = /srv
```

This PR normalizes the share configuration between samba and rsync (and some day netatalk), so you can configure a share between the two like this:
```
let srvShare = { path = "/srv"; "read only" = "yes"; comment = "public share"; }; in
{ services.samba.shares = { inherit srvShare };
services.rsync.modules = { inherit srvShare };
}
```

"types.attrsOf (types.attrsOf types.str)" may seem like a weak type for a config option but is no weaker than "extraConfig" options. It also prevents two modules from declaring the same share, something that is possible by concatenating extraConfigs.

This breaks the current rsyncd config, which is a currently list of submodels for modules (shares). I wrote the rsyncd service before I really knew what I was doing.

(BTW, this is me trying to PXE boot an installer with a nix store backed by samba rather than squashfs.)