diff options
author | talyz <kim.lindberger@gmail.com> | 2019-10-08 15:52:11 +0200 |
---|---|---|
committer | talyz <kim.lindberger@gmail.com> | 2019-10-08 15:52:11 +0200 |
commit | afa3abf632a07a627a651ae7f8fdaad0c6e8919b (patch) | |
tree | 5e6639d8b0ef8ba7ac59a2c9d2c3e3a1f3867cd6 /pkgs/applications/version-management/gitlab/default.nix | |
parent | 59324d1fb9d7deddcec3e7a4db705567880ca59c (diff) | |
download | nixlib-afa3abf632a07a627a651ae7f8fdaad0c6e8919b.tar nixlib-afa3abf632a07a627a651ae7f8fdaad0c6e8919b.tar.gz nixlib-afa3abf632a07a627a651ae7f8fdaad0c6e8919b.tar.bz2 nixlib-afa3abf632a07a627a651ae7f8fdaad0c6e8919b.tar.lz nixlib-afa3abf632a07a627a651ae7f8fdaad0c6e8919b.tar.xz nixlib-afa3abf632a07a627a651ae7f8fdaad0c6e8919b.tar.zst nixlib-afa3abf632a07a627a651ae7f8fdaad0c6e8919b.zip |
gitlab: Refactor for new repo structure
GitLab recently restructured their repos; whereas previously they had one gitlab-ce and one gitlab-ee repo, they're now one and the same. All proprietary components are put into the ee subdirectory - removing it gives us the foss / community version of GitLab. For more info, see https://about.gitlab.com/2019/02/21/merging-ce-and-ee-codebases/ This gives us the opportunity to simplify things quite a bit, since we don't have to keep track of two separate versions of either the base data or rubyEnv.
Diffstat (limited to 'pkgs/applications/version-management/gitlab/default.nix')
-rw-r--r-- | pkgs/applications/version-management/gitlab/default.nix | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pkgs/applications/version-management/gitlab/default.nix b/pkgs/applications/version-management/gitlab/default.nix index 969d8e5b3b48..ad5e22430ba7 100644 --- a/pkgs/applications/version-management/gitlab/default.nix +++ b/pkgs/applications/version-management/gitlab/default.nix @@ -5,8 +5,7 @@ }: let - flavour = if gitlabEnterprise then "ee" else "ce"; - data = (builtins.fromJSON (builtins.readFile ./data.json)).${flavour}; + data = (builtins.fromJSON (builtins.readFile ./data.json)); version = data.version; src = fetchFromGitLab { @@ -19,7 +18,7 @@ let rubyEnv = bundlerEnv rec { name = "gitlab-env-${version}"; inherit ruby; - gemdir = ./rubyEnv- + (if gitlabEnterprise then "ee" else "ce"); + gemdir = ./rubyEnv; gemset = let x = import (gemdir + "/gemset.nix"); in x // { @@ -93,7 +92,7 @@ let }; in stdenv.mkDerivation { - name = "gitlab${if gitlabEnterprise then "-ee" else ""}-${version}"; + name = "gitlab${lib.optionalString gitlabEnterprise "-ee"}-${version}"; inherit src; @@ -104,6 +103,11 @@ stdenv.mkDerivation { patches = [ ./remove-hardcoded-locations.patch ]; postPatch = '' + ${lib.optionalString (!gitlabEnterprise) '' + # Remove all proprietary components + rm -rf ee + ''} + # For reasons I don't understand "bundle exec" ignores the # RAILS_ENV causing tests to be executed that fail because we're # not installing development and test gems above. Deleting the @@ -138,7 +142,7 @@ stdenv.mkDerivation { ''; passthru = { - inherit rubyEnv; + inherit rubyEnv assets; ruby = rubyEnv.wrappedRuby; GITALY_SERVER_VERSION = data.passthru.GITALY_SERVER_VERSION; GITLAB_PAGES_VERSION = data.passthru.GITLAB_PAGES_VERSION; |