diff --git a/pkgs/applications/version-management/gitlab/default.nix b/pkgs/applications/version-management/gitlab/default.nix index 4cd64dc8ad93..5d2b923628b2 100644 --- a/pkgs/applications/version-management/gitlab/default.nix +++ b/pkgs/applications/version-management/gitlab/default.nix @@ -122,7 +122,10 @@ stdenv.mkDerivation { rubyEnv rubyEnv.wrappedRuby rubyEnv.bundler tzdata git nettools ]; - patches = [ ./remove-hardcoded-locations.patch ]; + patches = [ + # Change hardcoded paths to the NixOS equivalent + ./remove-hardcoded-locations.patch + ]; postPatch = '' ${lib.optionalString (!gitlabEnterprise) '' diff --git a/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix b/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix index c86c63a5656a..51e48958ab76 100644 --- a/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix +++ b/pkgs/applications/version-management/gitlab/gitlab-shell/default.nix @@ -7,14 +7,14 @@ buildGoModule rec { owner = "gitlab-org"; repo = "gitlab-shell"; rev = "v${version}"; - sha256 = "sha256-wDZLcCBbWjG6wIcEj02eqwWVfAYy1TuAo/xvJB8tt+0="; + sha256 = "sha256-j/80AIIJdRSisu2fNXcqazb4oIzAQP5CfxHX3l6yijY="; }; buildInputs = [ ruby ]; patches = [ ./remove-hardcoded-locations.patch ]; - vendorSha256 = "16fa3bka0008x2yazahc6xxcv4fa6yqg74kk64v8lrp7snbvjf4d"; + vendorSha256 = "sha256-/jJTMtS5fcbQroWuaPPfvYxy6znNS0FOXVN7IcE/spQ="; postInstall = '' cp -r "$NIX_BUILD_TOP/source"/bin/* $out/bin diff --git a/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch b/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch index 888994adc927..8bbfd97e00ef 100644 --- a/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch +++ b/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch @@ -1,34 +1,25 @@ diff --git a/internal/config/config.go b/internal/config/config.go -index 79c2a36..12ba31e 100644 +index 36f8625..72ede08 100644 --- a/internal/config/config.go +++ b/internal/config/config.go -@@ -3,7 +3,6 @@ package config - import ( - "io/ioutil" - "net/url" -- "os" - "path" - "path/filepath" +@@ -12,7 +12,7 @@ import ( + ) -@@ -59,16 +58,13 @@ func (c *Config) GetHttpClient() *client.HttpClient { - } + const ( +- configFile = "config.yml" ++ configFile = "shell-config.yml" + defaultSecretFileName = ".gitlab_shell_secret" + ) - func New() (*Config, error) { -- dir, err := os.Getwd() -- if err != nil { -- return nil, err -- } -+ dir := "/run/gitlab" - - return NewFromDir(dir) - } - - func NewFromDir(dir string) (*Config, error) { -- return newFromFile(path.Join(dir, configFile)) -+ return newFromFile("/run/gitlab/shell-config.yml") - } - - func newFromFile(filename string) (*Config, error) { +@@ -91,7 +91,7 @@ func (c *Config) GetHttpClient() *client.HttpClient { + // NewFromDirExternal returns a new config from a given root dir. It also applies defaults appropriate for + // gitlab-shell running in an external SSH server. + func NewFromDirExternal(dir string) (*Config, error) { +- cfg, err := newFromFile(filepath.Join(dir, configFile)) ++ cfg, err := newFromFile(filepath.Join("/run/gitlab", configFile)) + if err != nil { + return nil, err + } diff --git a/internal/keyline/key_line.go b/internal/keyline/key_line.go index c6f2422..fb0426b 100644 --- a/internal/keyline/key_line.go @@ -55,6 +46,3 @@ index 52ac5ee..d96baa3 100644 end def auth_file --- -2.28.0 -