diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index c8a36f66a1..5db2e7f96a 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -64,5 +64,5 @@ common-updater-scripts = pkgs.common-updater-scripts.override { nix = pkgs.nix_2_3; }; -} // (import ./heptapod-runner.nix args) +} // (import ./heptapod-runner args) // (import ./lightspeed args) diff --git a/nix/pkgs/heptapod-runner.nix b/nix/pkgs/heptapod-runner/default.nix similarity index 85% rename from nix/pkgs/heptapod-runner.nix rename to nix/pkgs/heptapod-runner/default.nix index cf2523eb44..c16fea8d90 100644 --- a/nix/pkgs/heptapod-runner.nix +++ b/nix/pkgs/heptapod-runner/default.nix @@ -16,7 +16,7 @@ in inherit version; buildInputs = oldAttrs.buildInputs ++ [ pkgs.makeWrapper ]; src = newSrc; - patches = [ "${depot.third_party.nixpkgs.path}/pkgs/development/tools/continuous-integration/gitlab-runner/fix-shell-path.patch" ]; + patches = [ ./fix-shell-path.patch ]; }); heptapod-runner-mercurial = pkgs.symlinkJoin { name = pkgs.mercurial.name; diff --git a/nix/pkgs/heptapod-runner/fix-shell-path.patch b/nix/pkgs/heptapod-runner/fix-shell-path.patch new file mode 100644 index 0000000000..19585554b7 --- /dev/null +++ b/nix/pkgs/heptapod-runner/fix-shell-path.patch @@ -0,0 +1,24 @@ +diff --git a/shells/bash.go b/shells/bash.go +--- a/shells/bash.go ++++ b/shells/bash.go +@@ -5,6 +5,7 @@ import ( + "bytes" + "fmt" + "io" ++ "os/exec" + "path" + "runtime" + "strconv" +@@ -249,7 +250,11 @@ func (b *BashShell) GetConfiguration(inf + if info.User != "" { + script.Command = "su" + if runtime.GOOS == "linux" { +- script.Arguments = append(script.Arguments, "-s", "/bin/"+b.Shell) ++ shellPath, err := exec.LookPath(b.Shell) ++ if err != nil { ++ shellPath = "/bin/" + b.Shell ++ } ++ script.Arguments = append(script.Arguments, "-s", shellPath) + } + script.Arguments = append( + script.Arguments,