{ config, lib, pkgs, ... }:

{
  services.samba = {
    enable = true;
    securityType = "share";
    nsswins = true;
    extraConfig = ''
      workgroup = WORKGROUP
      server string = samba
      netbios name = samba
      security = ${config.services.samba.securityType}
      hosts allow = 10.0.1  localhost
      hosts deny = 0.0.0.0/0
      guest account = nobody
      map to guest = bad user
    '';
    shares.public = {
      # FIXME Change path accordingly
      sharepath = "/vault/samba";
      browseable = "yes";
      "read only" = "no";
      "guest ok" = "yes";
      "create mask" = "0644";
      "directory mask" = "0755";
      "force user" = "nobody";
      "force group" = "nobody";
    };
  };
}