From 84b49fdbf4598c0617345574db1d5a3008caed09 Mon Sep 17 00:00:00 2001 From: allow Date: Thu, 1 Aug 2024 12:49:07 -0500 Subject: [PATCH] fix peers picking defaults from networks --- dev/flake.lock | 6 +++--- flake-modules/flake-guard/default.nix | 21 +++++---------------- flake-modules/flake-guard/options.nix | 4 ++-- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/dev/flake.lock b/dev/flake.lock index 9d8112b..f4eef3f 100644 --- a/dev/flake.lock +++ b/dev/flake.lock @@ -39,12 +39,12 @@ "lynx": { "locked": { "lastModified": 0, - "narHash": "sha256-oCWdiOAOLcpHGqgDK4SI0YxAGaKG0gXh/Bdfpk2Z82g=", - "path": "/nix/store/r0cw739fasyi7yfpzlvj4dax4x04i88r-source", + "narHash": "sha256-v0ReozVthsOumWqvMBhT9Htrum4eyN8faHdN2ftdNRI=", + "path": "/nix/store/n50bmaygf5cfmb975xw5hxrakygf7axm-source", "type": "path" }, "original": { - "path": "/nix/store/r0cw739fasyi7yfpzlvj4dax4x04i88r-source", + "path": "/nix/store/n50bmaygf5cfmb975xw5hxrakygf7axm-source", "type": "path" } }, diff --git a/flake-modules/flake-guard/default.nix b/flake-modules/flake-guard/default.nix index fe428f3..f129b3c 100644 --- a/flake-modules/flake-guard/default.nix +++ b/flake-modules/flake-guard/default.nix @@ -49,11 +49,11 @@ in let cfg = config.flake-guard.networks; in { - # imports = [ - # (mkRenamedOptionModule - # [ "networking" "wireguard" "networks" ] - # [ "flake-guard" "networks" ]) - # ]; + imports = [ + (mkRenamedOptionModule + [ "networking" "wireguard" "networks" ] + [ "flake-guard" "networks" ]) + ]; options.flake-guard = { enable = mkEnableOption "enable flake-guard nixos module"; @@ -108,17 +108,6 @@ in self = mkOption { type = types.attrsOf types.unspecified; - - # types.submodule { - # options = node-options.options // { - # found = mkEnableOption "self was found."; - - # peers = mkOption { - # type = types.attrsOf types.unspecified; - # default = {}; - # }; - # }; - # }; default = {}; }; }; diff --git a/flake-modules/flake-guard/options.nix b/flake-modules/flake-guard/options.nix index 4360249..adcbf2d 100644 --- a/flake-modules/flake-guard/options.nix +++ b/flake-modules/flake-guard/options.nix @@ -85,7 +85,7 @@ in ((peer // { inherit groups; keyLookup = peer-name; - hostWriter = mkGuardOpt "hostsWriter"; + hostsWriter = mkGuardOpt "hostsWriter"; interfaceWriter = mkGuardOpt "interfaceWriter"; secretslookup = mkGuardOpt "secretsLookup"; listenPort = mkGuardOpt "listenPort"; @@ -117,7 +117,7 @@ in # a = 1; interfaceName = net-name; # peers.by-group = by-group; - # peers.by-name = by-name; + peers.by-name = by-name; })) # ) config.wireguard.networks; ) config.wireguard.networks);