anchor.diff:  
     shareConfig = name:
       let share = getAttr name cfg.shares; in
  -    "[${name}]\n " + (toString (
  +    "[${name}]\n " + (smbToString (
          map
  -         (key: "${key} = ${toString (getAttr key share)}\n")
  +         (key: "${key} = ${smbToString (getAttr key share)}\n")
            (attrNames share)
       ));
   
  
positive.code:       [ global ]
        security = ${cfg.securityType}
        passwd program = /var/setuid-wrappers/passwd %u
        pam password change = ${if cfg.syncPasswordsByPam then "yes" else "no"}
        invalid users = ${toString cfg.invalidUsers}
  
        ${cfg.extraConfig}
  
        ${toString (map shareConfig (attrNames cfg.shares))}
      '');
  
    # This may include nss_ldap, needed for samba if it has to use ldap.
  
negative.code: with lib;
  
  let
  
    smbToString = x: if builtins.typeOf x == "bool"
                     then (if x then "true" else "false")
                     else toString x;
  
    cfg = config.services.samba;
  
  