about summary refs log tree commit diff
path: root/nixos/doc/manual
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2024-02-09 08:22:09 +0100
committerGitHub <noreply@github.com>2024-02-09 08:22:09 +0100
commit4916e228123744637bf89906a210b86a37251226 (patch)
tree4bb7d7e03642037329f483e4bf42bad1955f9c84 /nixos/doc/manual
parent251c69b73037f0a1b961c6216cb45872615f0a2a (diff)
parentbbce103ca8d450a9278dcf494657e03558c6d8ab (diff)
downloadnixlib-4916e228123744637bf89906a210b86a37251226.tar
nixlib-4916e228123744637bf89906a210b86a37251226.tar.gz
nixlib-4916e228123744637bf89906a210b86a37251226.tar.bz2
nixlib-4916e228123744637bf89906a210b86a37251226.tar.lz
nixlib-4916e228123744637bf89906a210b86a37251226.tar.xz
nixlib-4916e228123744637bf89906a210b86a37251226.tar.zst
nixlib-4916e228123744637bf89906a210b86a37251226.zip
Merge pull request #286176 from nikstur/writable-overlays
nixos/filesystems: init overlayfs
Diffstat (limited to 'nixos/doc/manual')
-rw-r--r--nixos/doc/manual/configuration/file-systems.chapter.md1
-rw-r--r--nixos/doc/manual/configuration/overlayfs.section.md27
-rw-r--r--nixos/doc/manual/release-notes/rl-2405.section.md5
3 files changed, 33 insertions, 0 deletions
diff --git a/nixos/doc/manual/configuration/file-systems.chapter.md b/nixos/doc/manual/configuration/file-systems.chapter.md
index aca978be064d..3dfdd20ac33e 100644
--- a/nixos/doc/manual/configuration/file-systems.chapter.md
+++ b/nixos/doc/manual/configuration/file-systems.chapter.md
@@ -39,4 +39,5 @@ and non-critical by adding `options = [ "nofail" ];`.
 ```{=include=} sections
 luks-file-systems.section.md
 sshfs-file-systems.section.md
+overlayfs.section.md
 ```
diff --git a/nixos/doc/manual/configuration/overlayfs.section.md b/nixos/doc/manual/configuration/overlayfs.section.md
new file mode 100644
index 000000000000..592fb7c2e6f7
--- /dev/null
+++ b/nixos/doc/manual/configuration/overlayfs.section.md
@@ -0,0 +1,27 @@
+# Overlayfs {#sec-overlayfs}
+
+NixOS offers a convenient abstraction to create both read-only as well writable
+overlays.
+
+```nix
+fileSystems = {
+  "/writable-overlay" = {
+    overlay = {
+      lowerdir = [ writableOverlayLowerdir ];
+      upperdir = "/.rw-writable-overlay/upper";
+      workdir = "/.rw-writable-overlay/work";
+    };
+    # Mount the writable overlay in the initrd.
+    neededForBoot = true;
+  };
+  "/readonly-overlay".overlay.lowerdir = [
+    writableOverlayLowerdir
+    writableOverlayLowerdir2
+  ];
+};
+```
+
+If `upperdir` and `workdir` are not null, they will be created before the
+overlay is mounted.
+
+To mount an overlay as read-only, you need to provide at least two `lowerdir`s.
diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md
index bad1fd449bbb..d3efc1789cdc 100644
--- a/nixos/doc/manual/release-notes/rl-2405.section.md
+++ b/nixos/doc/manual/release-notes/rl-2405.section.md
@@ -272,6 +272,11 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
 - The option [`services.nextcloud.config.dbport`] of the Nextcloud module was removed to match upstream.
   The port can be specified in [`services.nextcloud.config.dbhost`](#opt-services.nextcloud.config.dbhost).
 
+- A new abstraction to create both read-only as well as writable overlay file
+  systems was added. Available via
+  [fileSystems.overlay](#opt-fileSystems._name_.overlay.lowerdir). See also the
+  [NixOS docs](#sec-overlayfs).
+
 - `stdenv`: The `--replace` flag in `substitute`, `substituteInPlace`, `substituteAll`, `substituteAllStream`, and `substituteStream` is now deprecated if favor of the new `--replace-fail`, `--replace-warn` and `--replace-quiet`. The deprecated `--replace` equates to `--replace-warn`.
 
 - New options were added to the dnsdist module to enable and configure a DNSCrypt endpoint (see `services.dnsdist.dnscrypt.enable`, etc.).