From 7a8d50a80381188e6fbdda7b2dd517ca71c3b487 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Thu, 16 Aug 2018 18:31:10 +0900 Subject: [PATCH] xdg: create $XDG_CACHE_HOME Some programs fail silently (bash with HISTFILE for instance) when the folder doesn't exist. --- modules/misc/xdg.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/misc/xdg.nix b/modules/misc/xdg.nix index 3e7a3bcb5..c3e7981b7 100644 --- a/modules/misc/xdg.nix +++ b/modules/misc/xdg.nix @@ -6,6 +6,8 @@ let cfg = config.xdg; + dag = config.lib.dag; + fileType = (import ../lib/file-type.nix { inherit (config.home) homeDirectory; inherit lib pkgs; @@ -91,6 +93,9 @@ in { home.file = mkMerge [ cfg.configFile cfg.dataFile ]; + home.activation.xdgCreateCache = dag.entryAfter [ "writeBoundary" ] '' + $DRY_RUN_CMD mkdir $VERBOSE_ARG -m0700 -p "${config.xdg.cacheHome}" + ''; } ]; }