1diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb
2index 0b11ce3..ffc3faf 100644
3--- a/lib/gitlab_projects.rb
4+++ b/lib/gitlab_projects.rb
5@@ -8,7 +8,7 @@ require_relative 'gitlab_metrics'
6 require_relative 'gitlab_metrics'
7
8 class GitlabProjects
9- GLOBAL_HOOKS_DIRECTORY = File.join(ROOT_PATH, 'hooks')
10+ GLOBAL_HOOKS_DIRECTORY = ENV['GITLAB_SHELL_HOOKS_PATH'] || File.join(ROOT_PATH, 'hooks')
11
12 # Project name is a directory name for repository with .git at the end
13 # It may be namespaced or not. Like repo.git or gitlab/repo.git
14diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
15index e7d0254..181ec8a 100644
16--- a/lib/gitlab_shell.rb
17+++ b/lib/gitlab_shell.rb
18@@ -188,7 +188,8 @@ class GitlabShell
19 end
20
21 # We use 'chdir: ROOT_PATH' to let the next executable know where config.yml is.
22- Kernel::exec(env, *args, unsetenv_others: true, chdir: ROOT_PATH)
23+ # Except we don't, because we're already in the right directory on nixos !
24+ Kernel::exec(env, *args, unsetenv_others: true)
25 end
26
27 def api
28diff --git a/go/internal/config/config.go b/go/internal/config/config.go
29index c57b4de..88cfc95 100644
30--- a/go/internal/config/config.go
31+++ b/go/internal/config/config.go
32@@ -27,7 +27,7 @@ func New() (*Config, error) {
33 }
34 cfg.RootDir = dir
35
36- configBytes, err := ioutil.ReadFile(path.Join(cfg.RootDir, configFile))
37+ configBytes, err := ioutil.ReadFile(os.Getenv("GITLAB_SHELL_CONFIG_PATH"))
38 if err != nil {
39 return nil, err
40 }