mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
Read per-user settings from ~/.config/nix/nix.conf
This commit is contained in:
parent
562585e901
commit
f05d5f89ff
8 changed files with 70 additions and 24 deletions
|
@ -429,6 +429,18 @@ Path getCacheDir()
|
|||
}
|
||||
|
||||
|
||||
Path getConfigDir()
|
||||
{
|
||||
Path configDir = getEnv("XDG_CONFIG_HOME");
|
||||
if (configDir.empty()) {
|
||||
Path homeDir = getEnv("HOME");
|
||||
if (homeDir.empty()) throw Error("$XDG_CONFIG_HOME and $HOME are not set");
|
||||
configDir = homeDir + "/.config";
|
||||
}
|
||||
return configDir;
|
||||
}
|
||||
|
||||
|
||||
Paths createDirs(const Path & path)
|
||||
{
|
||||
Paths created;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue