1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-26 11:49:47 +01:00
home-manager/tests/modules/misc/xdg/file-gen.nix

37 lines
1.2 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
{
config = {
xdg.configHome = /. + "${config.home.homeDirectory}/.dummy-config";
xdg.dataHome = /. + "${config.home.homeDirectory}/.dummy-data";
xdg.cacheHome = /. + "${config.home.homeDirectory}/.dummy-cache";
xdg.stateHome = /. + "${config.home.homeDirectory}/.dummy-state";
xdg.configFile.test.text = "config";
xdg.dataFile.test.text = "data";
2024-09-06 14:55:36 +02:00
xdg.stateFile.test.text = "state";
home.file."${config.xdg.cacheHome}/test".text = "cache";
nmt.script = ''
assertFileExists home-files/.dummy-config/test
assertFileExists home-files/.dummy-cache/test
assertFileExists home-files/.dummy-data/test
assertFileExists home-files/.dummy-state/test
assertFileContent \
home-files/.dummy-config/test \
${builtins.toFile "test" "config"}
assertFileContent \
home-files/.dummy-data/test \
${builtins.toFile "test" "data"}
assertFileContent \
home-files/.dummy-cache/test \
${builtins.toFile "test" "cache"}
assertFileContent \
home-files/.dummy-state/test \
${builtins.toFile "test" "state"}
'';
};
}