mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-16 05:51:08 +01:00
xdg: add option 'xdg.cacheFile' (#6548)
Allow declarative configuration of files in configured xdg cache home.
This commit is contained in:
parent
b71edac7a3
commit
f0b5e7e8a7
1 changed files with 11 additions and 0 deletions
|
|
@ -24,6 +24,15 @@ in {
|
||||||
options.xdg = {
|
options.xdg = {
|
||||||
enable = mkEnableOption "management of XDG base directories";
|
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 {
|
cacheHome = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
defaultText = "~/.cache";
|
defaultText = "~/.cache";
|
||||||
|
|
@ -136,6 +145,8 @@ in {
|
||||||
|
|
||||||
{
|
{
|
||||||
home.file = mkMerge [
|
home.file = mkMerge [
|
||||||
|
(mapAttrs' (name: file: nameValuePair "${cfg.cacheHome}/${name}" file)
|
||||||
|
cfg.cacheFile)
|
||||||
(mapAttrs' (name: file: nameValuePair "${cfg.configHome}/${name}" file)
|
(mapAttrs' (name: file: nameValuePair "${cfg.configHome}/${name}" file)
|
||||||
cfg.configFile)
|
cfg.configFile)
|
||||||
(mapAttrs' (name: file: nameValuePair "${cfg.dataHome}/${name}" file)
|
(mapAttrs' (name: file: nameValuePair "${cfg.dataHome}/${name}" file)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue