nixos/yggdrasil: Fix stray 0-byte /private-key file (#538065)

This commit is contained in:
Florian Klink 2026-07-06 12:19:39 +00:00 committed by GitHub
commit 8bb61a40df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,17 +33,11 @@ let
else else
null; null;
# Build base configuration with systemd credential path override
baseSettings = baseSettings =
cfg.settings cfg.settings
// ( // lib.optionalAttrs (effectiveKeyPath != null) {
if effectiveKeyPath != null then PrivateKeyPath = "/run/credentials/yggdrasil.service/private-key";
{ };
PrivateKeyPath = "/private-key";
}
else
{ }
);
# Remove null values that yggdrasil doesn't expect # Remove null values that yggdrasil doesn't expect
cleanSettings = lib.filterAttrs (n: v: v != null) baseSettings; cleanSettings = lib.filterAttrs (n: v: v != null) baseSettings;
@ -327,7 +321,6 @@ in
StateDirectory = "yggdrasil"; StateDirectory = "yggdrasil";
RuntimeDirectory = "yggdrasil"; RuntimeDirectory = "yggdrasil";
RuntimeDirectoryMode = "0750"; RuntimeDirectoryMode = "0750";
BindReadOnlyPaths = lib.optional (effectiveKeyPath != null) "%d/private-key:/private-key";
LoadCredential = lib.optional (effectiveKeyPath != null) "private-key:${effectiveKeyPath}"; LoadCredential = lib.optional (effectiveKeyPath != null) "private-key:${effectiveKeyPath}";
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE"; AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";