diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix index 20b87af23a5a..f5d37172a101 100644 --- a/nixos/modules/services/misc/gitlab.nix +++ b/nixos/modules/services/misc/gitlab.nix @@ -666,7 +666,6 @@ in { "d ${gitlabConfig.production.shared.path}/artifacts 0750 ${cfg.user} ${cfg.group} -" "d ${gitlabConfig.production.shared.path}/lfs-objects 0750 ${cfg.user} ${cfg.group} -" "d ${gitlabConfig.production.shared.path}/pages 0750 ${cfg.user} ${cfg.group} -" - "L+ ${cfg.statePath}/lib - - - - ${cfg.packages.gitlab}/share/gitlab/lib" "L+ /run/gitlab/config - - - - ${cfg.statePath}/config" "L+ /run/gitlab/log - - - - ${cfg.statePath}/log" "L+ /run/gitlab/tmp - - - - ${cfg.statePath}/tmp" diff --git a/pkgs/applications/version-management/gitlab/default.nix b/pkgs/applications/version-management/gitlab/default.nix index 99b408bcef32..e6ed0ef53a22 100644 --- a/pkgs/applications/version-management/gitlab/default.nix +++ b/pkgs/applications/version-management/gitlab/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, fetchurl, fetchFromGitLab, bundlerEnv , ruby, tzdata, git, nettools, nixosTests, nodejs , gitlabEnterprise ? false, callPackage, yarn -, yarn2nix-moretea +, yarn2nix-moretea, replace }: let @@ -118,6 +118,13 @@ stdenv.mkDerivation { sed -i '/ask_to_continue/d' lib/tasks/gitlab/two_factor.rake sed -ri -e '/log_level/a config.logger = Logger.new(STDERR)' config/environments/production.rb + + # Always require lib-files and application.rb through their store + # path, not their relative state directory path. This gets rid of + # warnings and means we don't have to link back to lib from the + # state directory. + ${replace}/bin/replace-literal -f -r -e '../lib' "$out/share/gitlab/lib" config + ${replace}/bin/replace-literal -f -r -e "require_relative 'application'" "require_relative '$out/share/gitlab/config/application'" config ''; buildPhase = ''