1
1
Fork 1
mirror of https://github.com/oddlama/nixos-extra-modules.git synced 2025-10-10 22:00:39 +02:00

fix: don't fail if id file is not set

This commit is contained in:
oddlama 2025-09-13 23:27:33 +02:00
parent 7565d8554b
commit 4c6b6489a4
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
2 changed files with 4 additions and 11 deletions

View file

@ -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
[

View file

@ -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;