From 2b3ac063a46ef7c6cad00da0e626ae927b466dbe Mon Sep 17 00:00:00 2001 From: Yurii Matsiuk Date: Mon, 26 Apr 2021 14:37:54 +0200 Subject: [PATCH 1/2] teleport: 6.1.2 -> 6.1.3 --- pkgs/servers/teleport/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/teleport/default.nix b/pkgs/servers/teleport/default.nix index c9ace581c7e..0c26e5e7e04 100644 --- a/pkgs/servers/teleport/default.nix +++ b/pkgs/servers/teleport/default.nix @@ -11,14 +11,14 @@ in buildGoModule rec { pname = "teleport"; - version = "6.1.2"; + version = "6.1.3"; # This repo has a private submodule "e" which fetchgit cannot handle without failing. src = fetchFromGitHub { owner = "gravitational"; repo = "teleport"; rev = "v${version}"; - sha256 = "sha256-4ZaebTTgGrGRQbMfDw1PL/qtDKmHbSY6kPmWyFeIcAU="; + sha256 = "sha256-kb7qRPZKXDY0Qy3/72epAGaN2FCOO/XAN8lOoUYkoM0="; }; vendorSha256 = null; @@ -54,8 +54,8 @@ buildGoModule rec { postInstall = '' install -Dm755 -t $client/bin $out/bin/tsh - wrapProgram $client/bin/tsh --prefix PATH : ${xdg-utils}/bin - wrapProgram $out/bin/tsh --prefix PATH : ${xdg-utils}/bin + wrapProgram $client/bin/tsh --prefix PATH : ${lib.makeBinPath [ xdg-utils ]} + wrapProgram $out/bin/tsh --prefix PATH : ${lib.makeBinPath [ xdg-utils ]} ''; doInstallCheck = true; From abc4290fa1843a92b507463c9f0b2a22f290e256 Mon Sep 17 00:00:00 2001 From: Yurii Matsiuk Date: Mon, 26 Apr 2021 14:45:28 +0200 Subject: [PATCH 2/2] teleport: patch os.Executable() call in tsh --- pkgs/servers/teleport/default.nix | 3 +++ pkgs/servers/teleport/tsh.patch | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 pkgs/servers/teleport/tsh.patch diff --git a/pkgs/servers/teleport/default.nix b/pkgs/servers/teleport/default.nix index 0c26e5e7e04..348681799a6 100644 --- a/pkgs/servers/teleport/default.nix +++ b/pkgs/servers/teleport/default.nix @@ -27,6 +27,9 @@ buildGoModule rec { nativeBuildInputs = [ zip makeWrapper ]; + # https://github.com/NixOS/nixpkgs/issues/120738 + patches = [ ./tsh.patch ]; + postBuild = '' pushd . mkdir -p build diff --git a/pkgs/servers/teleport/tsh.patch b/pkgs/servers/teleport/tsh.patch new file mode 100644 index 00000000000..0d614f063d4 --- /dev/null +++ b/pkgs/servers/teleport/tsh.patch @@ -0,0 +1,17 @@ +diff --git a/tool/tsh/tsh.go b/tool/tsh/tsh.go +index 57379c40f..cb4d7b84c 100644 +--- a/tool/tsh/tsh.go ++++ b/tool/tsh/tsh.go +@@ -514,10 +514,11 @@ func Run(args []string, opts ...cliOption) error { + } + } + +- cf.executablePath, err = os.Executable() ++ tempBinaryPath, err := os.Executable() + if err != nil { + return trace.Wrap(err) + } ++ cf.executablePath = path.Dir(tempBinaryPath) + "/tsh" + + if err := client.ValidateAgentKeyOption(cf.AddKeysToAgent); err != nil { + return trace.Wrap(err)