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

{
  imports = [ ];

  config = {
    # environment.systemPackages = with pkgs; [
    #   e2fsprogs # mkfs.ext4
    #   gptfdisk # cgdisk
    # ];

    # Mount the local disk
    fileSystems = lib.mkIf config.me.mountPersistence {
      "/.disk" = lib.mkForce {
        device = "/dev/nvme0n1p1";
        fsType = "ext4";
        options = [
          "noatime"
          "discard"
        ];
        neededForBoot = true;
      };

      # "/.persist" = lib.mkForce {
      #   device = "bind9p";
      #   fsType = "9p";
      #   options = [
      #     "noatime"
      #     "trans=virtio"
      #     "version=9p2000.L"
      #     "cache=mmap"
      #     "msize=512000"
      #     "uname=root"
      #     "dfltuid=0"
      #     "dfltgid=0"
      #     "nodevmap"
      #     # "noauto"
      #     # "x-systemd.automount"
      #   ];
      #   neededForBoot = true;
      # };

      "/persist" = {
        fsType = "none";
        device = "/.disk/persist";
        options = [
          "bind"
          "rw"
        ];
        depends = [
          "/.disk/persist"
        ];
        neededForBoot = true;
      };

      "/state" = {
        fsType = "none";
        device = "/.disk/state";
        options = [
          "bind"
          "rw"
        ];
        depends = [
          "/.disk/state"
        ];
        neededForBoot = true;
      };

      # "/nix/store" = lib.mkForce {
      #   overlay = {
      #     lowerdir = [ "/nix/.ro-store" ];
      #     upperdir = "/.disk/persist/store";
      #     workdir = "/.disk/state/work";
      #   };
      #   # fsType = "overlay";
      #   # device = "overlay";
      #   # options = [
      #   #   "lowerdir=/nix/.ro-store"
      #   #   "upperdir=/.disk/persist/store"
      #   #   "workdir=/.disk/state/work"
      #   # ];
      #   depends = [
      #     "/nix/.ro-store"
      #     "/.disk/persist/store"
      #     "/.disk/state/work"
      #   ];
      # };
    };
  };
}
