xdg: create $XDG_CACHE_HOME

Some programs fail silently (bash with HISTFILE for instance) when the
folder doesn't exist.
This commit is contained in:
Matthieu Coudron 2018-08-16 18:31:10 +09:00 committed by Robert Helgesson
parent 6630cfbe16
commit 7a8d50a803
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -6,6 +6,8 @@ let
cfg = config.xdg; cfg = config.xdg;
dag = config.lib.dag;
fileType = (import ../lib/file-type.nix { fileType = (import ../lib/file-type.nix {
inherit (config.home) homeDirectory; inherit (config.home) homeDirectory;
inherit lib pkgs; inherit lib pkgs;
@ -91,6 +93,9 @@ in
{ {
home.file = mkMerge [ cfg.configFile cfg.dataFile ]; home.file = mkMerge [ cfg.configFile cfg.dataFile ];
home.activation.xdgCreateCache = dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD mkdir $VERBOSE_ARG -m0700 -p "${config.xdg.cacheHome}"
'';
} }
]; ];
} }