Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
users.hh File Reference
#include "lix/libutil/types.hh"
#include <sys/types.h>

Go to the source code of this file.

Functions

std::string nix::getUserName ()
Path nix::getHomeOf (uid_t userId)
Path nix::getHome ()
Path nix::getCacheDir ()
Path nix::getConfigDir ()
std::vector< Pathnix::getConfigDirs ()
Path nix::getDataDir ()
Path nix::getStateDir ()
Path nix::createNixStateDir ()
std::string nix::expandTilde (std::string_view path)

Function Documentation

◆ createNixStateDir()

Path nix::createNixStateDir ( )

Create $XDG_STATE_HOME/nix or $HOME/.local/state/nix, and return the path to it.

Note
Not to be confused with settings.nixStateDir.

◆ expandTilde()

std::string nix::expandTilde ( std::string_view path)

Perform tilde expansion on a path.

◆ getCacheDir()

Path nix::getCacheDir ( )
Returns
$XDG_CACHE_HOME or $HOME/.cache.

◆ getConfigDir()

Path nix::getConfigDir ( )
Returns
$XDG_CONFIG_HOME or $HOME/.config.

◆ getConfigDirs()

std::vector< Path > nix::getConfigDirs ( )
Returns
the directories to search for user configuration files

◆ getDataDir()

Path nix::getDataDir ( )
Returns
$XDG_DATA_HOME or $HOME/.local/share.

◆ getHome()

Path nix::getHome ( )
Returns
$HOME or the user's home directory from /etc/passwd.

◆ getHomeOf()

Path nix::getHomeOf ( uid_t userId)
Returns
the given user's home directory from /etc/passwd.

◆ getStateDir()

Path nix::getStateDir ( )
Returns
$XDG_STATE_HOME or $HOME/.local/state.
Note
Not to be confused with settings.nixStateDir.