{
  flake,
  ...
}:
let
  inherit (flake.config.services) instances;
  inherit (flake.config.people) user0;
  service = instances.samba;
in
{
  # If you ever need to start fresh, you need to add yourself to the Samba users database:
  # sudo smbpasswd -a username
  services = {
    samba = {
      # package = pkgs.samba4Full;
      enable = true;
      openFirewall = true;
      settings = {
        "raid0" = {
          path = "/mnt/raid0";
          writable = "yes";
          "valid users" = user0;
          "force user" = user0;
          "force group" = "users";
          "create mask" = "0644";
          "directory mask" = "0755";
        };
      };
    };
  };

  systemd.tmpfiles.rules = [
    "d /mnt/raid0 0755 ${user0} users -"
    "Z /mnt/raid0 0755 ${user0} users -"
  ];

  networking = {
    firewall = {
      allowedTCPPorts = [
        service.ports.port0
      ];
    };
  };
}
