1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-15 05:21:06 +01:00

xdg: add option 'xdg.cacheFile' (#6548)

Allow declarative configuration of files in configured xdg cache home.
This commit is contained in:
Manuel Mendez 2025-02-28 21:36:56 -05:00 committed by GitHub
parent b71edac7a3
commit f0b5e7e8a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,6 +24,15 @@ in {
options.xdg = {
enable = mkEnableOption "management of XDG base directories";
cacheFile = mkOption {
type = fileType "xdg.cacheFile" "{var}`xdg.cacheHome`" cfg.cacheHome;
default = { };
description = ''
Attribute set of files to link into the user's XDG
cache home.
'';
};
cacheHome = mkOption {
type = types.path;
defaultText = "~/.cache";
@ -136,6 +145,8 @@ in {
{
home.file = mkMerge [
(mapAttrs' (name: file: nameValuePair "${cfg.cacheHome}/${name}" file)
cfg.cacheFile)
(mapAttrs' (name: file: nameValuePair "${cfg.configHome}/${name}" file)
cfg.configFile)
(mapAttrs' (name: file: nameValuePair "${cfg.dataHome}/${name}" file)