Open Skarlett opened 7 months ago
While implementing a new attribute ontop of wireguard.networks.my-network.peers.by-name.my-host
, instead of directly implementing psk.peers
.
It also be reasonable to instead swap the two keys (peers.psk
), so that if there are more extensions to how each host wants to treat other peers on the network.
The only downside with this idea, is it would be nice to reference peers.by-name.*
alongside these modifications.
The end result would look something like the following
wireguard.networks.my-network.peers.by-name =
let
peers = config.wireguard.networks.my-network.peers.by-name;
in {
my-host = {
publicKey = ...
peers = {
my-peer = {
psk.sopsLookup = "psk-my-peer";
allowedIPs = [ "10.0.0.100" ]; # <- possible future feature for configuring the interface locally?
};
};
};
}
Though I'm not a fan of the double use of peers
, I think if there to be a more unique name it'd be a perfect adjustment.
Related:
7
RFC
These fields will be automatically constructed from
wireguard.networks.*.sopsPskPrefix = "psk-";
Issue tracking the support of Preshared keys in flake-guard options.