xdg: disambiguate home.file attribute names

This commit is contained in:
arcnmx 2020-10-11 17:22:58 -07:00 committed by Robert Helgesson
parent 22a3a5651d
commit 9bf1f40af1
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 37 additions and 6 deletions

View file

@ -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 = ""; }
];
}
];

View file

@ -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;
}

View 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"}
'';
};
}