Preamble
Overlay Filesystems are a type of filesystem mount, which overlay two directories lowerdir and upperdir on top of each other into mountTarget.
Changes to the contents of files below mountTarget are written into upperdir, with lowerdir being completely unaffected (ergo, lowerdir can be located on a read-only filesystem).
There are some constraints:
Overlay Filesystems require a workdir, which has to be located on the same filesystem as upperdir, a filesystem which has to support extended attributes. This is required to support whiteout files (files or directories which hide a file or directory that is in fact present in lowerdir). For further information the linux kernel documentation may be consulted
Subject
I would like to propose the usage of an overlay type mount for the server directory, with lowerdir being a built nix store path. This would facilitate multiple things, such as managing default configurations from within the nix configuration without inhibiting the server from modifying them later.
Additionally, issues like in #191 would not be a problem with this feature.
Implementation
Functionality for this would need to be opt-in, as to not break compatibility with existing servers, and to avoid filesystem incompatibility issues.
I imagine something like an overlayfs options set, with options to enable the feature and to control the location of both upperdir and workdir non-individually, with a default being /srv/minecraft/.overlayfs/<servername>/alternatively, an attrs option persistentFiles could be Implemented next to symlinks, with non-emptyness being a signal to enable the overlayfs , though I would advocate for the former suggestion
Preamble
Overlay Filesystems are a type of filesystem mount, which overlay two directories
lowerdirandupperdiron top of each other intomountTarget.Changes to the contents of files below
mountTargetare written intoupperdir, withlowerdirbeing completely unaffected (ergo,lowerdircan be located on a read-only filesystem).There are some constraints:
Overlay Filesystems require a
workdir, which has to be located on the same filesystem asupperdir, a filesystem which has to support extended attributes. This is required to support whiteout files (files or directories which hide a file or directory that is in fact present inlowerdir). For further information the linux kernel documentation may be consultedSubject
I would like to propose the usage of an overlay type mount for the server directory, with
lowerdirbeing a built nix store path. This would facilitate multiple things, such as managing default configurations from within the nix configuration without inhibiting the server from modifying them later.Additionally, issues like in #191 would not be a problem with this feature.
Implementation
Functionality for this would need to be opt-in, as to not break compatibility with existing servers, and to avoid filesystem incompatibility issues.
I imagine something like an
overlayfsoptions set, with options to enable the feature and to control the location of bothupperdirandworkdirnon-individually, with a default being/srv/minecraft/.overlayfs/<servername>/alternatively, anattrsoptionpersistentFilescould be Implemented next tosymlinks, with non-emptyness being a signal to enable the overlayfs, though I would advocate for the former suggestion