nixos/yggdrasil: fix for configFile option
The configFile was not being merged with the declarative configuration at runtime.
This commit is contained in:
parent
fdca231242
commit
6c1c99d6b4
|
@ -12,11 +12,11 @@ let
|
||||||
configFileProvided = (cfg.configFile != null);
|
configFileProvided = (cfg.configFile != null);
|
||||||
generateConfig = (
|
generateConfig = (
|
||||||
if configProvided && configFileProvided then
|
if configProvided && configFileProvided then
|
||||||
"${pkgs.jq}/bin/jq -s add /run/yggdrasil/configFile.json ${configAsFile}"
|
"${pkgs.jq}/bin/jq -s add ${configAsFile} ${cfg.configFile}"
|
||||||
else if configProvided then
|
else if configProvided then
|
||||||
"cat ${configAsFile}"
|
"cat ${configAsFile}"
|
||||||
else if configFileProvided then
|
else if configFileProvided then
|
||||||
"cat /run/yggdrasil/configFile.json"
|
"cat ${cfg.configFile}"
|
||||||
else
|
else
|
||||||
"${cfg.package}/bin/yggdrasil -genconf"
|
"${cfg.package}/bin/yggdrasil -genconf"
|
||||||
);
|
);
|
||||||
|
@ -147,7 +147,7 @@ in {
|
||||||
RuntimeDirectory = "yggdrasil";
|
RuntimeDirectory = "yggdrasil";
|
||||||
RuntimeDirectoryMode = "0700";
|
RuntimeDirectoryMode = "0700";
|
||||||
BindReadOnlyPaths = mkIf configFileProvided
|
BindReadOnlyPaths = mkIf configFileProvided
|
||||||
[ "${cfg.configFile}:/run/yggdrasil/configFile.json" ];
|
[ "${cfg.configFile}" ];
|
||||||
|
|
||||||
# TODO: as of yggdrasil 0.3.8 and systemd 243, yggdrasil fails
|
# TODO: as of yggdrasil 0.3.8 and systemd 243, yggdrasil fails
|
||||||
# to set up the network adapter when DynamicUser is set. See
|
# to set up the network adapter when DynamicUser is set. See
|
||||||
|
|
Loading…
Reference in New Issue