home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit 30b1af7072df85ee51b26c4d3e4fa521355fdfa1
parent 291163667b16e79765b926c25e1878ee8c1d91dc
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Fri, 29 Oct 2021 12:29:26 +0200

systems: explore using the toml instead of machines.nix

Importing toml in metadata in naruhodo to start with, might move this
import elsewhere later on.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Msystems/hosts/naruhodo.nix | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/systems/hosts/naruhodo.nix b/systems/hosts/naruhodo.nix @@ -10,13 +10,12 @@ let secretPath = ../../secrets/machines.nix; secretCondition = (builtins.pathExists secretPath); - ip = strings.optionalString secretCondition (import secretPath).wireguard.ips."${hostname}"; - ips = lists.optionals secretCondition ([ "${ip}/24" ]); endpointIP = strings.optionalString secretCondition (import secretPath).wg.endpointIP; endpointPort = if secretCondition then (import secretPath).wg.listenPort else 0; endpointPublicKey = strings.optionalString secretCondition (import secretPath).wireguard.kerkouane.publicKey; getEmulator = system: (lib.systems.elaborate { inherit system; }).emulator pkgs; + metadata = importTOML ../../ops/hosts.toml; in { imports = [ @@ -165,15 +164,16 @@ in acpilight ]; + # warnings = "metadata… ${metadata.hosts.naruhodo.wireguard.addrs.v4}"; services = { wireguard = { enable = true; - ips = ips; + ips = [ "${metadata.hosts.naruhodo.wireguard.addrs.v4}/24" ]; endpoint = endpointIP; endpointPort = endpointPort; endpointPublicKey = endpointPublicKey; }; - syncthing.guiAddress = "${ip}:8384"; + syncthing.guiAddress = "${metadata.hosts.naruhodo.wireguard.addrs.v4}:8384"; }; systemd.services.buildkitd.wantedBy = lib.mkForce [ ]; systemd.services.containerd.wantedBy = lib.mkForce [ ];