Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
environment-variables.hh
Go to the documentation of this file.
1#pragma once
8
9#include <optional>
10
11#include "types.hh"
12#include "file-path.hh"
13
14namespace nix {
15
16static constexpr auto environmentVariablesCategory = "Options that change environment variables";
17
21std::optional<std::string> getEnv(const std::string & key);
22
26std::optional<OsString> getEnvOs(const OsString & key);
27
32std::optional<std::string> getEnvNonEmpty(const std::string & key);
33
37std::map<std::string, std::string> getEnv();
38
39#ifdef _WIN32
43int unsetenv(const char * name);
44#endif
45
52int setEnv(const char * name, const char * value);
53
57int setEnvOs(const OsString & name, const OsString & value);
58
62void clearEnv();
63
67void replaceEnv(const std::map<std::string, std::string> & newEnv);
68
69}
std::optional< OsString > getEnvOs(const OsString &key)
int setEnvOs(const OsString &name, const OsString &value)
int setEnv(const char *name, const char *value)
const T::key_type & key
Definition lexer.l:2763
const std::string_view & name
Definition lexer.l:1709
const T & value
Definition lexer.l:492
std::basic_string< OsChar > OsString
Definition os-string.hh:32