diff options
author | Malte Voos <git@mal.tc> | 2025-02-19 21:16:51 +0100 |
---|---|---|
committer | Malte Voos <git@mal.tc> | 2025-02-19 21:16:51 +0100 |
commit | 0b2391075932d3b78a4e700cd464f068874b6127 (patch) | |
tree | 9f1770c2ce739473af400f4229aa68675a7236d3 /client.nix | |
parent | e1bbd03df6324936fb63e676f562e47e51b0a837 (diff) | |
download | reMder-0b2391075932d3b78a4e700cd464f068874b6127.tar.gz reMder-0b2391075932d3b78a4e700cd464f068874b6127.zip |
update to firmware version v3.14.1.9
Diffstat (limited to 'client.nix')
-rw-r--r-- | client.nix | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/client.nix b/client.nix index 67c083c..ad58693 100644 --- a/client.nix +++ b/client.nix @@ -1,33 +1,43 @@ -{ writeShellApplication, curl, openssh, sshpass, rsync, sshPassword, sshPort -, httpPort }: +{ + writeShellApplication, + curl, + openssh, + sshpass, + rsync, + sshPassword, + sshPort, + httpPort, +}: writeShellApplication { name = "reMder-client"; - runtimeInputs = [ curl openssh sshpass rsync ]; + runtimeInputs = [ + curl + openssh + sshpass + rsync + ]; - text = let - ssh = - "sshpass -p ${sshPassword} ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${ - toString sshPort - }"; - guest = "root@127.0.0.1"; - documentDir = "/home/root/.local/share/remarkable/xochitl"; - in '' - in="$1" - out="$2" + text = + let + ssh = "sshpass -p ${sshPassword} ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${toString sshPort}"; + guest = "root@127.0.0.1"; + documentDir = "/home/root/.local/share/remarkable/xochitl"; + in + '' + in="$1" + out="$2" - in_basename="$(basename "$in")" + in_basename="$(basename "$in")" - ${ssh} ${guest} rm -rf ${documentDir} - ${ssh} ${guest} mkdir ${documentDir} + ${ssh} ${guest} rm -rf ${documentDir} + ${ssh} ${guest} mkdir ${documentDir} - rsync --rsh="${ssh}" "$in" ${guest}:${documentDir} - ${ssh} ${guest} "unzip '${documentDir}/$in_basename' -d ${documentDir}" - doc_id="$(${ssh} ${guest} find ${documentDir} -name '\*.metadata' -exec basename {} .metadata '\;')" + rsync --rsh="${ssh}" "$in" ${guest}:${documentDir} + ${ssh} ${guest} "unzip '${documentDir}/$in_basename' -d ${documentDir}" + doc_id="$(${ssh} ${guest} find ${documentDir} -name '\*.metadata' -exec basename {} .metadata '\;')" - curl -f -o "$out" "http://127.0.0.1:${ - toString httpPort - }/download/$doc_id/placeholder" - ''; + curl -f -o "$out" "http://127.0.0.1:${toString httpPort}/download/$doc_id/placeholder" + ''; } |