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