mirror of
https://github.com/nix-community/home-manager
synced 2024-12-02 16:09:46 +01:00
move curl shell function into string variable
Allows us to reuse the function in different scripts.
This commit is contained in:
parent
3d034b9906
commit
295a580ca7
1 changed files with 10 additions and 6 deletions
|
@ -66,12 +66,7 @@ let
|
|||
''}
|
||||
'';
|
||||
|
||||
updateConfig = pkgs.writers.writeBash "merge-syncthing-config" (''
|
||||
set -efu
|
||||
|
||||
# be careful not to leak secrets in the filesystem or in process listings
|
||||
umask 0077
|
||||
|
||||
curlShellFunction = ''
|
||||
curl() {
|
||||
# get the api key by parsing the config.xml
|
||||
while
|
||||
|
@ -85,6 +80,15 @@ let
|
|||
--retry 1000 --retry-delay 1 --retry-all-errors \
|
||||
"$@"
|
||||
}
|
||||
'';
|
||||
|
||||
updateConfig = pkgs.writers.writeBash "merge-syncthing-config" (''
|
||||
set -efu
|
||||
|
||||
# be careful not to leak secrets in the filesystem or in process listings
|
||||
umask 0077
|
||||
|
||||
${curlShellFunction}
|
||||
'' +
|
||||
|
||||
/* Syncthing's rest API for the folders and devices is almost identical.
|
||||
|
|
Loading…
Reference in a new issue