diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2024-01-22 12:01:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 12:01:10 +0000 |
commit | 3a8094730e6ff9783b31c423af848b63abbeaebb (patch) | |
tree | 69bfe4e1abfdf5b0334ae81eb1fa7141b757dd98 /nixos/doc/manual/development/etc-overlay.section.md | |
parent | 78b0905b1bfbbfc6879ecb23813966ad1b9639b5 (diff) | |
parent | 4e2e46fe89b071e008ee30908770e19c0f89ad2a (diff) | |
download | nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.gz nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.bz2 nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.lz nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.xz nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.tar.zst nixlib-3a8094730e6ff9783b31c423af848b63abbeaebb.zip |
Merge master into staging-next
Diffstat (limited to 'nixos/doc/manual/development/etc-overlay.section.md')
-rw-r--r-- | nixos/doc/manual/development/etc-overlay.section.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/nixos/doc/manual/development/etc-overlay.section.md b/nixos/doc/manual/development/etc-overlay.section.md new file mode 100644 index 000000000000..e6f6d8d4ca1e --- /dev/null +++ b/nixos/doc/manual/development/etc-overlay.section.md @@ -0,0 +1,36 @@ +# `/etc` via overlay filesystem {#sec-etc-overlay} + +::: {.note} +This is experimental and requires a kernel version >= 6.6 because it uses +new overlay features and relies on the new mount API. +::: + +Instead of using a custom perl script to activate `/etc`, you activate it via an +overlay filesystem: + +```nix +system.etc.overlay.enable = true; +``` + +Using an overlay has two benefits: + +1. it removes a dependency on perl +2. it makes activation faster (up to a few seconds) + +By default, the `/etc` overlay is mounted writable (i.e. there is a writable +upper layer). However, you can also mount `/etc` immutably (i.e. read-only) by +setting: + +```nix +system.etc.overlay.mutable = false; +``` + +The overlay is atomically replaced during system switch. However, files that +have been modified will NOT be overwritten. This is the biggest change compared +to the perl-based system. + +If you manually make changes to `/etc` on your system and then switch to a new +configuration where `system.etc.overlay.mutable = false;`, you will not be able +to see the previously made changes in `/etc` anymore. However the changes are +not completely gone, they are still in the upperdir of the previous overlay in +`/.rw-etc/upper`. |