aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/network-filesystems/cachefilesd.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/network-filesystems/cachefilesd.nix')
-rw-r--r--nixpkgs/nixos/modules/services/network-filesystems/cachefilesd.nix18
1 files changed, 11 insertions, 7 deletions
diff --git a/nixpkgs/nixos/modules/services/network-filesystems/cachefilesd.nix b/nixpkgs/nixos/modules/services/network-filesystems/cachefilesd.nix
index 61981340840..229c9665419 100644
--- a/nixpkgs/nixos/modules/services/network-filesystems/cachefilesd.nix
+++ b/nixpkgs/nixos/modules/services/network-filesystems/cachefilesd.nix
@@ -43,17 +43,21 @@ in
config = mkIf cfg.enable {
+ boot.kernelModules = [ "cachefiles" ];
+
systemd.services.cachefilesd = {
description = "Local network file caching management daemon";
wantedBy = [ "multi-user.target" ];
- path = [ pkgs.kmod pkgs.cachefilesd ];
- script = ''
- modprobe -qab cachefiles
- mkdir -p ${cfg.cacheDir}
- chmod 700 ${cfg.cacheDir}
- exec cachefilesd -n -f ${cfgFile}
- '';
+ serviceConfig = {
+ Type = "exec";
+ ExecStart = "${pkgs.cachefilesd}/bin/cachefilesd -n -f ${cfgFile}";
+ Restart = "on-failure";
+ PrivateTmp = true;
+ };
};
+ systemd.tmpfiles.rules = [
+ "d ${cfg.cacheDir} 0700 root root - -"
+ ];
};
}