diff options
author | Robert Hensing <robert@roberthensing.nl> | 2023-02-01 17:12:11 +0100 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2023-04-07 16:24:18 +0200 |
commit | a58be394769fb174ee4b6ff5ce16744cf5806485 (patch) | |
tree | 45cd9685c6958acba4a7a4c3a805662c525f6c3a /src/libstore/globals.cc | |
parent | 969307671500cb6cb9c01ab91c1d815ebd6a644b (diff) |
Move sodium_init() to initLibStore()
Part of an effort to make it easier to initialize the right things,
by moving code into the appropriate libraries.
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index b18525dd7..1e66838c5 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -13,6 +13,8 @@ #include <nlohmann/json.hpp> +#include <sodium/core.h> + namespace nix { @@ -292,6 +294,9 @@ void assertLibStoreInitialized() { void initLibStore() { + if (sodium_init() == -1) + throw Error("could not initialise libsodium"); + loadConfFile(); initLibStoreDone = true; |