Merge pull request #97123 from peterhoeg/m/fscache

nixos/cachefilesd: don't set up manually
This commit is contained in:
Peter Hoeg 2020-09-06 10:23:32 +08:00 committed by GitHub
commit 5483b1e216
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,17 +43,21 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
boot.kernelModules = [ "cachefiles" ];
systemd.services.cachefilesd = { systemd.services.cachefilesd = {
description = "Local network file caching management daemon"; description = "Local network file caching management daemon";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
path = [ pkgs.kmod pkgs.cachefilesd ]; serviceConfig = {
script = '' Type = "exec";
modprobe -qab cachefiles ExecStart = "${pkgs.cachefilesd}/bin/cachefilesd -n -f ${cfgFile}";
mkdir -p ${cfg.cacheDir} Restart = "on-failure";
chmod 700 ${cfg.cacheDir} PrivateTmp = true;
exec cachefilesd -n -f ${cfgFile} };
'';
}; };
systemd.tmpfiles.rules = [
"d ${cfg.cacheDir} 0700 root root - -"
];
}; };
} }