From 6b68a4f5d8b61e91585b422a7b42f98ac6ec007f Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 24 Jan 2021 01:24:19 +0100 Subject: [PATCH] tv cr: use XDG_RUNTIME_DIR --- tv/5pkgs/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix index fd3d2f32a..cae5da112 100644 --- a/tv/5pkgs/default.nix +++ b/tv/5pkgs/default.nix @@ -13,13 +13,17 @@ foldl' mergeAttrs {} // { - # TODO use XDG_RUNTIME_DIR? cr = self.writeDashBin "cr" '' set -efu + if test -n "''${XDG_RUNTIME_DIR-}"; then + cache_dir=$XDG_RUNTIME_DIR/chromium-disk-cache + else + cache_dir=/tmp/chromium-disk-cache_$LOGNAME + fi export LC_TIME=de_DE.utf8 exec ${self.chromium}/bin/chromium \ --ssl-version-min=tls1 \ - --disk-cache-dir=/tmp/chromium-disk-cache_"$LOGNAME" \ + --disk-cache-dir="$cache_dir" \ --disk-cache-size=50000000 \ "$@" '';