cgit-clear-cache: init

This commit is contained in:
tv 2018-08-28 20:58:23 +02:00
parent ce31457b77
commit 23d2950ed7
2 changed files with 9 additions and 3 deletions

View File

@ -403,9 +403,7 @@ let
)); ));
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writeDashBin "cgit-clear-cache" '' (pkgs.cgit-clear-cache.override { inherit (cfg.cgit.settings) cache-root; })
${pkgs.coreutils}/bin/rm -f ${cfg.cgit.settings.cache-root}/*
'')
]; ];
system.activationScripts.cgit = '' system.activationScripts.cgit = ''

View File

@ -0,0 +1,8 @@
with import <stockholm/lib>;
{ cache-root ? "/tmp/cgit", findutils, writeDashBin }:
writeDashBin "cgit-clear-cache" ''
set -efu
${findutils}/bin/find ${shell.escape cache-root} -type f -delete
''