Merge pull request #314508 from aaronjheng/croc

This commit is contained in:
Sandro 2024-05-27 13:51:34 +02:00 committed by GitHub
commit f37d2a285a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

@ -2,13 +2,13 @@
buildGoModule rec {
pname = "croc";
version = "9.6.16";
version = "10.0.5";
src = fetchFromGitHub {
owner = "schollz";
repo = pname;
rev = "v${version}";
sha256 = "sha256-rAOWiu0f9f1v1oD5HI/kl1knoHkU2LgS3D2qsdd98y4=";
hash = "sha256-JrlNvfOxoOhvsjaRacGLZAc4r9HG69UdjFjb3GnSnW0=";
};
vendorHash = "sha256-SxdN1IyQd/DLI8ZXyCWsW3JLi4dlGSvpr+ub/Oqkw70=";
@ -20,6 +20,7 @@ buildGoModule rec {
local-relay = callPackage ./test-local-relay.nix { };
};
};
meta = with lib; {
description = "Easily and securely send things from one computer to another";
longDescription = ''

@ -6,15 +6,20 @@ stdenv.mkDerivation {
nativeBuildInputs = [ croc ];
buildCommand = ''
HOME=$(mktemp -d)
HOME="$(mktemp -d)"
# start a local relay
croc relay --ports 11111,11112 &
export CROC_SECRET="sN3nx4hGLeihmn8G"
# start sender in background
MSG="See you later, alligator!"
croc --relay localhost:11111 send --code correct-horse-battery-staple --text "$MSG" &
# wait for things to settle
sleep 1
MSG2=$(croc --relay localhost:11111 --yes correct-horse-battery-staple)
# compare
[ "$MSG" = "$MSG2" ] && touch $out
'';