add clanlib.nix documentation

This commit is contained in:
Ingolf Wagner 2024-06-07 13:51:35 +02:00
parent afe2b88068
commit c5b5857a39
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -15,7 +15,13 @@ let
else else
null; null;
# machine -> factvalue # Example:
#
# readFactFromAllMachines zerotier-ip
# => {
# machineA = "1.2.3.4";
# machineB = "5.6.7.8";
# };
readFactFromAllMachines = fact: readFactFromAllMachines = fact:
let let
machines = allMachineNames; machines = allMachineNames;
@ -24,8 +30,23 @@ let
in in
filteredFacts; filteredFacts;
# returns an Attrs of machines and it's facts which have all given facts set. # all given facts are are set and factvalues are never null.
# machine -> fact -> value #
# Example:
#
# readFactsFromAllMachines [ "zerotier-ip" "syncthing.pub" ]
# => {
# machineA =
# {
# "zerotier-ip" = "1.2.3.4";
# "synching.pub" = "1234";
# };
# machineB =
# {
# "zerotier-ip" = "5.6.7.8";
# "synching.pub" = "23456719";
# };
# };
readFactsFromAllMachines = facts: readFactsFromAllMachines = facts:
let let
# machine -> fact -> factvalue # machine -> fact -> factvalue