mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
xdg: disambiguate home.file
attribute names
This commit is contained in:
parent
22a3a5651d
commit
9bf1f40af1
3 changed files with 37 additions and 6 deletions
|
@ -101,11 +101,13 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
home.file = mkMerge [
|
home.file = mkMerge [
|
||||||
cfg.configFile
|
(mapAttrs'
|
||||||
cfg.dataFile
|
(name: file: nameValuePair "${config.xdg.configHome}/${name}" file)
|
||||||
{
|
cfg.configFile)
|
||||||
"${config.xdg.cacheHome}/.keep".text = "";
|
(mapAttrs'
|
||||||
}
|
(name: file: nameValuePair "${config.xdg.dataHome}/${name}" file)
|
||||||
|
cfg.dataFile)
|
||||||
|
{ "${config.xdg.cacheHome}/.keep".text = ""; }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
{ xdg-mime-apps-basics = ./mime-apps-basics.nix; }
|
{
|
||||||
|
xdg-mime-apps-basics = ./mime-apps-basics.nix;
|
||||||
|
xdg-file-attr-names = ./file-attr-names.nix;
|
||||||
|
}
|
||||||
|
|
26
tests/modules/misc/xdg/file-attr-names.nix
Normal file
26
tests/modules/misc/xdg/file-attr-names.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
xdg.configFile.test.text = "config";
|
||||||
|
xdg.dataFile.test.text = "data";
|
||||||
|
home.file.test.text = "home";
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/test
|
||||||
|
assertFileExists home-files/.local/share/test
|
||||||
|
assertFileExists home-files/test
|
||||||
|
assertFileContent \
|
||||||
|
home-files/.config/test \
|
||||||
|
${builtins.toFile "test" "config"}
|
||||||
|
assertFileContent \
|
||||||
|
home-files/.local/share/test \
|
||||||
|
${builtins.toFile "test" "data"}
|
||||||
|
assertFileContent \
|
||||||
|
home-files/test \
|
||||||
|
${builtins.toFile "test" "home"}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue