restic: add openssh to PATH, refactor (#422189)

authored by

Masum Reza and committed by
GitHub
595d470e bb8f8edd

+19 -7
+19 -7
pkgs/by-name/re/restic/package.nix
··· 4 4 buildGoModule, 5 5 fetchFromGitHub, 6 6 installShellFiles, 7 - makeWrapper, 7 + makeBinaryWrapper, 8 + versionCheckHook, 8 9 nixosTests, 10 + openssh, 9 11 rclone, 10 12 python3, 11 13 }: ··· 32 34 33 35 nativeBuildInputs = [ 34 36 installShellFiles 35 - makeWrapper 37 + makeBinaryWrapper 36 38 ]; 37 39 38 40 nativeCheckInputs = [ python3 ]; 41 + 42 + doInstallCheck = true; 43 + nativeInstallCheckInputs = [ versionCheckHook ]; 44 + versionCheckProgramArg = "version"; 39 45 40 46 passthru.tests = lib.optionalAttrs stdenv.hostPlatform.isLinux { 41 47 restic = nixosTests.restic; ··· 46 52 ''; 47 53 48 54 postInstall = '' 49 - wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin' 55 + wrapProgram $out/bin/restic \ 56 + --prefix PATH : "${ 57 + lib.makeBinPath [ 58 + openssh 59 + rclone 60 + ] 61 + }" 50 62 '' 51 63 + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' 52 64 $out/bin/restic generate \ ··· 58 70 installManPage *.1 59 71 ''; 60 72 61 - meta = with lib; { 73 + meta = { 62 74 homepage = "https://restic.net"; 63 75 changelog = "https://github.com/restic/restic/blob/${src.rev}/CHANGELOG.md"; 64 76 description = "Backup program that is fast, efficient and secure"; 65 - platforms = platforms.linux ++ platforms.darwin; 66 - license = licenses.bsd2; 67 - maintainers = with maintainers; [ 77 + platforms = with lib.platforms; linux ++ darwin; 78 + license = lib.licenses.bsd2; 79 + maintainers = with lib.maintainers; [ 68 80 mbrgm 69 81 dotlambda 70 82 ryan4yin