forked from clan/clan-core
modules/syncthing: use generator path
This commit is contained in:
parent
284bec3299
commit
6cd3a8e58f
@ -193,12 +193,17 @@
|
|||||||
secrets."syncthing.cert" = { };
|
secrets."syncthing.cert" = { };
|
||||||
secrets."syncthing.api" = { };
|
secrets."syncthing.api" = { };
|
||||||
facts."syncthing.pub" = { };
|
facts."syncthing.pub" = { };
|
||||||
|
generator.path = [
|
||||||
|
pkgs.coreutils
|
||||||
|
pkgs.gnugrep
|
||||||
|
pkgs.syncthing
|
||||||
|
];
|
||||||
generator.script = ''
|
generator.script = ''
|
||||||
${pkgs.syncthing}/bin/syncthing generate --config "$secrets"
|
syncthing generate --config "$secrets"
|
||||||
mv "$secrets"/key.pem "$secrets"/syncthing.key
|
mv "$secrets"/key.pem "$secrets"/syncthing.key
|
||||||
mv "$secrets"/cert.pem "$secrets"/syncthing.cert
|
mv "$secrets"/cert.pem "$secrets"/syncthing.cert
|
||||||
cat "$secrets"/config.xml | ${pkgs.gnugrep}/bin/grep -oP '(?<=<device id=")[^"]+' | uniq > "$facts"/syncthing.pub
|
cat "$secrets"/config.xml | grep -oP '(?<=<device id=")[^"]+' | uniq > "$facts"/syncthing.pub
|
||||||
cat "$secrets"/config.xml | ${pkgs.gnugrep}/bin/grep -oP '<apikey>\K[^<]+' | uniq > "$secrets"/syncthing.api
|
cat "$secrets"/config.xml | grep -oP '<apikey>\K[^<]+' | uniq > "$secrets"/syncthing.api
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user