From be9be72afff75a6014a047187f3f178dfbe06c2a Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 20 Mar 2026 00:06:50 +0800 Subject: [PATCH] chore: preserve davfs2 driver's cache to avoid large memory usage --- hosts/idols-ai/netdev-mount.nix | 14 +++++++++++++- hosts/idols-ai/preservation.nix | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hosts/idols-ai/netdev-mount.nix b/hosts/idols-ai/netdev-mount.nix index d35f3fd0..81df4457 100644 --- a/hosts/idols-ai/netdev-mount.nix +++ b/hosts/idols-ai/netdev-mount.nix @@ -4,7 +4,19 @@ }: { # enable davfs2 driver for webdav - services.davfs2.enable = true; + services.davfs2 = { + enable = true; + # https://man.archlinux.org/man/davfs2.conf.5 + settings = { + globalSection.use_locks = true; + sections = { + "/mnt/fileshare" = { + # try to get this information from all files in a directory with one PROPFIND request. + gui_optimize = true; + }; + }; + }; + }; # mount a webdav share # https://wiki.archlinux.org/title/Davfs2 diff --git a/hosts/idols-ai/preservation.nix b/hosts/idols-ai/preservation.nix index 31700460..df3adc6e 100644 --- a/hosts/idols-ai/preservation.nix +++ b/hosts/idols-ai/preservation.nix @@ -48,6 +48,9 @@ in "/var/log" + # preserve davfs2 driver's cache to avoid large memory usage + "/var/cache/davfs2" + # system-core "/var/lib/nixos" "/var/lib/systemd"