1 { config, pkgs, lib, ... }:
7 cfg = config.services.cachefilesd;
9 cfgFile = pkgs.writeText "cachefilesd.conf" ''
18 services.cachefilesd = {
23 description = lib.mdDoc "Whether to enable cachefilesd network filesystems caching daemon.";
28 default = "/var/cache/fscache";
29 description = lib.mdDoc "Directory to contain filesystem cache.";
32 extraConfig = mkOption {
36 description = lib.mdDoc "Additional configuration file entries. See cachefilesd.conf(5) for more information.";
44 config = mkIf cfg.enable {
46 boot.kernelModules = [ "cachefiles" ];
48 systemd.services.cachefilesd = {
49 description = "Local network file caching management daemon";
50 wantedBy = [ "multi-user.target" ];
53 ExecStart = "${pkgs.cachefilesd}/bin/cachefilesd -n -f ${cfgFile}";
54 Restart = "on-failure";
59 systemd.tmpfiles.rules = [
60 "d ${cfg.cacheDir} 0700 root root - -"