diff options
author | Peter Hoeg <peter@hoeg.com> | 2020-09-04 16:11:55 +0800 |
---|---|---|
committer | Peter Hoeg <peter@hoeg.com> | 2020-09-04 16:11:55 +0800 |
commit | 6ef2152b5dcc86266db150981a0809f5fd295bcf (patch) | |
tree | 6166927a2f44653e6842d4dedaf5416d5e538894 /nixos | |
parent | c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38 (diff) |
nixos/cachefilesd: don't set up manually
Use our available infrastructure instead of manually handling setup.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/network-filesystems/cachefilesd.nix | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/nixos/modules/services/network-filesystems/cachefilesd.nix b/nixos/modules/services/network-filesystems/cachefilesd.nix index 619813408405f..229c9665419f5 100644 --- a/nixos/modules/services/network-filesystems/cachefilesd.nix +++ b/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 - -" + ]; }; } |