{
  flake,
  config,
  ...
}:
let
  inherit (flake.config.people) user0;
  inherit (flake.config.machines.devices) deimos ceres;
  inherit (flake.config.services) instances;

  ceresSecrets = config.sops.secrets."network/server".path;
in
{
  fileSystems =
    let

      sambaDrives = [
        "samba0"
      ];

      remoteDrives = [
        "remote0"
      ];

      remoteFolders = [
        instances.audiobookshelf.name
        instances.jellyfin.name
        instances.comfyui.name
        # instances.opencloud.name
      ];

      sambaMounts = sambaDrive: folder: {
        name = "${ceres.${sambaDrive}.mount}/${folder}";
        value = {
          device = "${ceres.${sambaDrive}.device}/${folder}";
          fsType = "cifs";
          options = ceres.${sambaDrive}.options ++ [
            "credentials=${ceresSecrets}"
          ];
        };
      };

      sshfsMounts = sshfsDrive: folder: {
        name = "${ceres.${sshfsDrive}.mount}/${folder}";
        value = {
          device = "${ceres.${sshfsDrive}.device}/${folder}";
          fsType = "sshfs";
          options = ceres.${sshfsDrive}.options;
        };
      };
    in
    {
      "/" = {
        device = "/dev/disk/by-uuid/aa9e7283-3e96-4d3e-a66b-ce24bba9f3f2";
        fsType = "ext4";
      };
      "/boot" = {
        device = "/dev/disk/by-uuid/0616-DAE7";
        fsType = "vfat";
        options = deimos.boot.options;
      };
    };
  # // (builtins.listToAttrs (
  #   builtins.concatMap (drive: map (folder: sambaMounts drive folder) remoteFolders) sambaDrives
  # ))
  # // (builtins.listToAttrs (
  #   builtins.concatMap (drive: map (folder: sshfsMounts drive folder) remoteFolders) remoteDrives
  # ));

  swapDevices = [
    { device = "/dev/disk/by-uuid/027a1efb-6c4e-4c1a-9956-91c7513950b4"; }
  ];

  systemd.tmpfiles.rules = [
    "Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
  ];

  services.udisks2.enable = true;
}
