fix: don't fail if id file is not set
This commit is contained in:
parent
7565d8554b
commit
4c6b6489a4
2 changed files with 4 additions and 11 deletions
|
@ -36,7 +36,7 @@ in
|
|||
flip mapAttrsToList memberWG (
|
||||
networkName: networkCfg:
|
||||
let
|
||||
assertionPrefix = "While evaluation the wireguard network ${networkName}:";
|
||||
assertionPrefix = "While evaluating the wireguard network ${networkName}:";
|
||||
hostCfg = networkCfg.hosts.${config.node.name};
|
||||
in
|
||||
[
|
||||
|
|
|
@ -23,7 +23,7 @@ in
|
|||
options = {
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
description = "The host name or IP addresse for reaching the server node.";
|
||||
description = "The host name or IP address under which the server node is reachable from any client.";
|
||||
};
|
||||
idFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
|
@ -61,16 +61,9 @@ in
|
|||
config.id =
|
||||
let
|
||||
inherit (wgConf) idFile;
|
||||
idFromFile = if (idFile == null) then null else (importJSON idFile).${name} or null;
|
||||
in
|
||||
if (idFile == null) then
|
||||
null
|
||||
else
|
||||
(
|
||||
let
|
||||
conf = importJSON idFile;
|
||||
in
|
||||
conf.${name} or null
|
||||
);
|
||||
lib.mkIf (idFromFile != null) idFromFile;
|
||||
options = {
|
||||
server = mkOption {
|
||||
default = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue