mirror of
https://github.com/NixOS/nix.git
synced 2025-11-10 04:26:01 +01:00
This will facilitate breaking up Nix into multiple packages for each component with Meson.
31 lines
707 B
C++
31 lines
707 B
C++
#include "file-system.hh"
|
|
#include "globals.hh"
|
|
#include "keys.hh"
|
|
|
|
namespace nix {
|
|
|
|
PublicKeys getDefaultPublicKeys()
|
|
{
|
|
PublicKeys publicKeys;
|
|
|
|
// FIXME: filter duplicates
|
|
|
|
for (auto s : settings.trustedPublicKeys.get()) {
|
|
PublicKey key(s);
|
|
publicKeys.emplace(key.name, key);
|
|
}
|
|
|
|
for (auto secretKeyFile : settings.secretKeyFiles.get()) {
|
|
try {
|
|
SecretKey secretKey(readFile(secretKeyFile));
|
|
publicKeys.emplace(secretKey.name, secretKey.toPublicKey());
|
|
} catch (SystemError & e) {
|
|
/* Ignore unreadable key files. That's normal in a
|
|
multi-user installation. */
|
|
}
|
|
}
|
|
|
|
return publicKeys;
|
|
}
|
|
|
|
}
|