Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
users.hh
Go to the documentation of this file.
1#pragma once
3
4#include <filesystem>
5#ifndef _WIN32
6# include <sys/types.h>
7#endif
8
9#include "nix/util/types.hh"
10
11namespace nix {
12
13std::string getUserName();
14
15#ifndef _WIN32
19std::filesystem::path getHomeOf(uid_t userId);
20#endif
21
25std::filesystem::path getHome();
26
30std::filesystem::path getCacheDir();
31
35std::filesystem::path getConfigDir();
36
40std::vector<std::filesystem::path> getConfigDirs();
41
45std::filesystem::path getDataDir();
46
50std::filesystem::path getStateDir();
51
55std::filesystem::path createNixStateDir();
56
61std::string expandTilde(std::string_view path);
62
68bool isRootUser();
69
70} // namespace nix
std::filesystem::path getCacheDir()
Definition users.cc:13
std::filesystem::path getConfigDir()
Definition users.cc:25
std::filesystem::path getHomeOf(uid_t userId)
Definition users.cc:22
bool isRootUser()
Definition users.cc:65
std::filesystem::path getDataDir()
Definition users.cc:51
std::filesystem::path createNixStateDir()
Definition users.cc:75
std::filesystem::path getHome()
Definition users.cc:32
std::filesystem::path getStateDir()
Definition users.cc:63
std::string expandTilde(std::string_view path)
Definition users.cc:82
std::vector< std::filesystem::path > getConfigDirs()
Definition users.cc:37