{
  pkgs,
  config,
  lib,
  ...
}:
# define smb shares
let
  cfg = config.holocron.smb;
  smb_shares = {
    archives = {
      path = "/holocron/archives";
      browseable = true;
      writable = true;
      guestOk = false;
      "create mask" = "0775";
      "directory mask" = "0775";
    };
    #    timemachine = {
    #      browseable = true;
    #      "path" = "/holocron/archives/timemachine";
    #      #"valid users" = "blake";
    #      "public" = "no";
    #      "writeable" = "yes";
    #      #"force user" = "blake";
    #      "fruit:aapl" = "yes";
    #      "fruit:time machine" = "yes";
    #      "vfs objects" = "catia fruit streams_xattr";
    #    };
    users = {
      path = "/holocron/users";
      browseable = true;
      writable = true;
      guestOk = false;
      "create mask" = "0660";
      "directory mask" = "0770";
    };
    media = {
      path = "/holocron/media";
      browseable = true;
      writable = true;
      guestOk = false;
      "create mask" = "0775";
      "directory mask" = "0775";
    };
  };
in {
  options.holocron.smb = {
    enable = lib.mkEnableOption "enables smb";
  };

  config = lib.mkIf cfg.enable {
    # enable smb with all shares
    services.samba = {
      enable = true;
      settings = smb_shares;
    };
  };
}
