28 lines
518 B
Nix
28 lines
518 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
let
|
|
hostname = config.instance.hostname;
|
|
host = config.fudo.hosts.${hostname};
|
|
domain-name = config.instance.local-domain;
|
|
domain = config.fudo.domains.${domain-name};
|
|
|
|
gateway = domain.wireguard.gateway;
|
|
|
|
is-wireguard-client =
|
|
gateway != null && gateway != hostname &&
|
|
host.wireguard.private-key-file != null;
|
|
|
|
in {
|
|
config = mkIf is-wireguard-client (let
|
|
|
|
in {
|
|
fudo.wireguard-client = {
|
|
enable = true;
|
|
server = {
|
|
|
|
};
|
|
};
|
|
});
|
|
}
|