diff --git a/pkgs/clan-cli/clan_cli/dirs.py b/pkgs/clan-cli/clan_cli/dirs.py index 172d29c78..553f0f720 100644 --- a/pkgs/clan-cli/clan_cli/dirs.py +++ b/pkgs/clan-cli/clan_cli/dirs.py @@ -68,7 +68,7 @@ def clan_config_dir() -> Path: def clan_flakes_dir() -> Path: - path = clan_data_dir() / "flake" + path = clan_config_dir() / "flakes" if not path.exists(): log.debug(f"Creating path with parents {path}") path.mkdir(parents=True) diff --git a/pkgs/clan-cli/tests/fixtures_flakes.py b/pkgs/clan-cli/tests/fixtures_flakes.py index cc0ce0738..c50b382b7 100644 --- a/pkgs/clan-cli/tests/fixtures_flakes.py +++ b/pkgs/clan-cli/tests/fixtures_flakes.py @@ -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 diff --git a/pkgs/clan-cli/tests/temporary_dir.py b/pkgs/clan-cli/tests/temporary_dir.py index 026998206..7bd2e656c 100644 --- a/pkgs/clan-cli/tests/temporary_dir.py +++ b/pkgs/clan-cli/tests/temporary_dir.py @@ -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))