1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-22 18:29:39 +01:00

xdg: add option 'xdg.stateFile'

This commit is contained in:
Bruno BELANYI 2024-09-06 13:55:36 +01:00 committed by GitHub
parent 03b49187a2
commit b00bdf59c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -70,6 +70,16 @@ in {
'';
};
stateFile = mkOption {
type = fileType "xdg.stateFile" "<varname>xdg.stateHome</varname>"
cfg.stateHome;
default = { };
description = ''
Attribute set of files to link into the user's XDG
state home.
'';
};
stateHome = mkOption {
type = types.path;
defaultText = "~/.local/state";
@ -122,6 +132,8 @@ in {
cfg.configFile)
(mapAttrs' (name: file: nameValuePair "${cfg.dataHome}/${name}" file)
cfg.dataFile)
(mapAttrs' (name: file: nameValuePair "${cfg.stateHome}/${name}" file)
cfg.stateFile)
{ "${cfg.cacheHome}/.keep".text = ""; }
];
}