1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 19:49:45 +01:00
home-manager/tests/modules/misc/xdg/default-locations.nix

36 lines
1 KiB
Nix
Raw Normal View History

2021-11-19 02:14:11 +01:00
{ config, lib, pkgs, ... }:
with lib;
{
config = {
# Test fallback behavior for stateVersion >= 20.09, which is pure.
xdg.enable = lib.mkForce false;
home.stateVersion = "20.09";
xdg.configFile.test.text = "config";
xdg.dataFile.test.text = "data";
home.file."${config.xdg.cacheHome}/test".text = "cache";
home.file."${config.xdg.stateHome}/test".text = "state";
nmt.script = ''
assertFileExists home-files/.config/test
assertFileExists home-files/.local/share/test
assertFileExists home-files/.cache/test
assertFileExists home-files/.local/state/test
assertFileContent \
home-files/.config/test \
${builtins.toFile "test" "config"}
assertFileContent \
home-files/.local/share/test \
${builtins.toFile "test" "data"}
assertFileContent \
home-files/.cache/test \
${builtins.toFile "test" "cache"}
assertFileContent \
home-files/.local/state/test \
${builtins.toFile "test" "state"}
'';
};
}