{ config, lib, ... }: {

  options.nfs.client.enable = lib.mkEnableOption "Enable Nas (via NFS) as a client";
  # options.nfs.server.enable = lib.mkEnableOption "Enable Nas (via NFS) as the server";

  config = lib.mkIf config.nfs.client.enable {
    fileSystems."/mnt/nas" = {
      device = "nixserver:/share";
      fsType = "nfs";
      options = [
        "nfsvers=4.2"
        "noauto"
        "x-systemd.automount"
        "x-systemd.idle-timeout=600"
        "_netdev"
      ];
    };
    fileSystems."/mnt/nas/torrent" = {
      device = "nixserver:/torrent";
      fsType = "nfs";
      options = [
        "nfsvers=4.2"
        "noauto"
        "x-systemd.automount"
        "x-systemd.idle-timeout=600"
        "_netdev"
      ];
    };
  };
}
