diff options
-rw-r--r-- | krebs/3modules/git.nix | 4 | ||||
-rw-r--r-- | krebs/5pkgs/simple/cgit-clear-cache.nix | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix index 5ae24b40b..89726fd7b 100644 --- a/krebs/3modules/git.nix +++ b/krebs/3modules/git.nix @@ -403,9 +403,7 @@ let )); environment.systemPackages = [ - (pkgs.writeDashBin "cgit-clear-cache" '' - ${pkgs.coreutils}/bin/rm -f ${cfg.cgit.settings.cache-root}/* - '') + (pkgs.cgit-clear-cache.override { inherit (cfg.cgit.settings) cache-root; }) ]; system.activationScripts.cgit = '' diff --git a/krebs/5pkgs/simple/cgit-clear-cache.nix b/krebs/5pkgs/simple/cgit-clear-cache.nix new file mode 100644 index 000000000..28402c39c --- /dev/null +++ b/krebs/5pkgs/simple/cgit-clear-cache.nix @@ -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 +'' |