mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-15 03:15:56 +03:00
nixos/cachefilesd: don't set up manually
Use our available infrastructure instead of manually handling setup.
This commit is contained in:
parent
c59ea8b8a0
commit
6ef2152b5d
@ -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 - -"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user