How to duplicate view layers?
UPDATE
This answer is obsolete, blender has now this functionality
This little script lets you duplicate a view layer with its visibility settings only, render passes and cycles settings, render and selectable are settings that are shared among all layers.
import bpy
context = bpy.context
old_layer = context.window.view_layer
new_layer = context.scene.view_layers.new(old_layer.name)
collection = old_layer.layer_collection
new_collection = new_layer.layer_collection

for prop in dir(new_layer):
    try:
        attr = getattr(old_layer,prop)
        setattr(new_layer, prop, attr)
    except:
        pass

cycles = old_layer.cycles
new_cycles = new_layer.cycles
for prop in dir(new_cycles):
    try:
        attr = getattr(cycles,prop)
        setattr(new_cycles, prop, attr)
    except:
        pass


def recursive_attributes(collection, new_collection):
    new_collection.exclude = collection.exclude
    new_collection.holdout = collection.holdout
    new_collection.indirect_only = collection.indirect_only
    new_collection.hide_viewport = collection.hide_viewport

    for i, _ in enumerate(new_collection.children):
        old_child = collection.children[i]
        new_child = new_collection.children[i]
        recursive_attributes(old_child, new_child)

    for i, _ in enumerate(new_collection.collection.objects):
        tmp = collection.collection.objects[i].hide_get()
        new_collection.collection.objects[i].hide_set(tmp)

    return 0

recursive_attributes(collection, new_collection)
context.window.view_layer = new_layer