alpha
Login
or
Join now
hermes.pds.lassul.us
/
superconfig
forked from
lass.pds.lassul.us/superconfig
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
add zerotier.nix to all machines
author
lassulus
date
2 years ago
(Jan 8, 2024, 9:28 PM CET)
commit
d526588c
d526588cfc68bde376fa3c3145e2ef06474161a0
parent
903fa4c8
903fa4c80ce0ca823490534867d977da31b6125f
+20
2 changed files
Expand all
Collapse all
Unified
Split
2configs
default.nix
zerotier.nix
+1
2configs/default.nix
View file
Reviewed
···
11
11
./tor-ssh.nix
12
12
./networkd.nix
13
13
./pinned-registry.nix
14
14
+
./zerotier.nix
14
15
self.inputs.stockholm.nixosModules.users
15
16
self.inputs.stockholm.nixosModules.hosts
16
17
self.inputs.stockholm.nixosModules.kartei
+19
2configs/zerotier.nix
View file
Reviewed
···
1
1
+
{ lib, ... }:
2
2
+
let
3
3
+
hosts = lib.mapAttrs (machine: _: {
4
4
+
ip = if builtins.pathExists ../machines/${machine}/facts/zerotier-ip then
5
5
+
builtins.readFile ../machines/${machine}/facts/zerotier-ip
6
6
+
else
7
7
+
null;
8
8
+
}) (builtins.readDir ../machines);
9
9
+
10
10
+
filteredHosts = lib.filterAttrs (name: host: host.ip != null) hosts;
11
11
+
12
12
+
in
13
13
+
{
14
14
+
clan.networking.zerotier.networkId = "7c31a21e86f9a75c";
15
15
+
16
16
+
networking.extraHosts = lib.concatMapStringsSep "\n" (host:
17
17
+
"${host.value.ip} ${host.name}.z"
18
18
+
) (lib.attrsToList filteredHosts);
19
19
+
}