1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

nix repl: Use $XDG_DATA_HOME for the readline history

This commit is contained in:
Eelco Dolstra 2017-04-25 18:56:29 +02:00
parent 921a2aeb05
commit 5bd8795e1f
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 19 additions and 3 deletions

View file

@ -441,6 +441,18 @@ Path getConfigDir()
}
Path getDataDir()
{
Path dataDir = getEnv("XDG_DATA_HOME");
if (dataDir.empty()) {
Path homeDir = getEnv("HOME");
if (homeDir.empty()) throw Error("$XDG_DATA_HOME and $HOME are not set");
dataDir = homeDir + "/.local/share";
}
return dataDir;
}
Paths createDirs(const Path & path)
{
Paths created;