move flake configuration to .config/clan/flakes rather than $XDG_DATA_DIRS

This commit is contained in:
Jörg Thalheim
2023-11-10 12:50:11 +01:00
parent cb2145be65
commit 48d7968cf9
3 changed files with 3 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ def create_flake(
template = Path(__file__).parent / flake_name
# copy the template to a new temporary location
flake = temporary_home / ".local/share/clan/flake" / flake_name
flake = temporary_home / ".config/clan/flakes" / flake_name
shutil.copytree(template, flake)
# lookup the requested machines in ./test_machines and include them

View File

@@ -21,6 +21,7 @@ def temporary_home(monkeypatch: pytest.MonkeyPatch) -> Iterator[Path]:
else:
with tempfile.TemporaryDirectory(prefix="pytest-") as dirpath:
monkeypatch.setenv("HOME", str(dirpath))
monkeypatch.setenv("XDG_CONFIG_HOME", str(Path(dirpath) / ".config"))
monkeypatch.setenv("XDG_DATA_HOME", str(Path(dirpath) / ".local/share"))
monkeypatch.chdir(str(dirpath))
log.debug("Temp HOME directory: %s", str(dirpath))