This repository has no description
904 B
38 lines
1{
2 config,
3 clanLib,
4 lib,
5 ...
6}:
7{
8 _class = "clan.service";
9 manifest.name = "retiolum";
10 manifest.description = "reach machines as <name>.r over retiolum (tinc); preferred over every other network";
11 manifest.categories = [ "Network" ];
12 manifest.exports.out = [
13 "networking"
14 "peer"
15 ];
16
17 exports = lib.mapAttrs' (instanceName: _: {
18 name = clanLib.buildScopeKey {
19 inherit instanceName;
20 serviceName = config.manifest.name;
21 };
22 value = {
23 # internet/yggdrasil are 2000; retiolum wins
24 networking.priority = 3000;
25 };
26 }) config.instances;
27
28 roles.default = {
29 description = "machine reachable as <name>.r; retiolum itself is configured in 2configs/retiolum.nix";
30 perInstance =
31 { mkExports, machine, ... }:
32 {
33 exports = mkExports {
34 peer.hosts = [ { plain = "${machine.name}.r"; } ];
35 };
36 };
37 };
38}