Unverified Commit f37d2a28 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #314508 from aaronjheng/croc

parents baf1c6e1 6f8ce597
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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 −1
Original line number Diff line number Diff line
@@ -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
  '';