mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
xdg: disambiguate home.file attribute names
This commit is contained in:
@@ -101,11 +101,13 @@ in
|
||||
|
||||
{
|
||||
home.file = mkMerge [
|
||||
cfg.configFile
|
||||
cfg.dataFile
|
||||
{
|
||||
"${config.xdg.cacheHome}/.keep".text = "";
|
||||
}
|
||||
(mapAttrs'
|
||||
(name: file: nameValuePair "${config.xdg.configHome}/${name}" file)
|
||||
cfg.configFile)
|
||||
(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"}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user