syncthing setup
This commit is contained in:
parent
24df8a251b
commit
52c074f973
19 changed files with 244 additions and 16 deletions
18
var/syncthing.nix
Normal file
18
var/syncthing.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ var, lib, ... }:
|
||||
let
|
||||
inherit (var.syncthing-managed-clients) managed_clients hashes;
|
||||
unmanaged = {
|
||||
# "roam".id = "OIKOKOT-LY4JWPX-T7OXE4D-I4ZC3IR-ZLMKFCO-IXSVEYZ-Y3FZOUB-LIG2XAO";
|
||||
};
|
||||
in
|
||||
assert (
|
||||
lib.assertMsg (
|
||||
builtins.attrNames hashes == managed_clients
|
||||
) "Not all declaratively configured syncthing clients have keys. Rerun ./bin/gen-syncthing-cert"
|
||||
);
|
||||
assert (
|
||||
lib.assertMsg (
|
||||
[ ] == (lib.intersectLists managed_clients (builtins.attrNames unmanaged))
|
||||
) "Syncthing clients must either be unmanaged or declaratively configured."
|
||||
);
|
||||
unmanaged // builtins.mapAttrs (_: v: { id = v; }) hashes
|
||||
Loading…
Add table
Add a link
Reference in a new issue