mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #93426 from helsinki-systems/feat/gitlab-pages
nixos/gitlab: Support pages
This commit is contained in:
commit
a6fec75d04
3 changed files with 64 additions and 0 deletions
|
@ -73,6 +73,11 @@ let
|
|||
|
||||
redisConfig.production.url = cfg.redisUrl;
|
||||
|
||||
pagesArgs = [
|
||||
"-pages-domain" gitlabConfig.production.pages.host
|
||||
"-pages-root" "${gitlabConfig.production.shared.path}/pages"
|
||||
] ++ cfg.pagesExtraArgs;
|
||||
|
||||
gitlabConfig = {
|
||||
# These are the default settings from config/gitlab.example.yml
|
||||
production = flip recursiveUpdate cfg.extraConfig {
|
||||
|
@ -236,6 +241,13 @@ in {
|
|||
description = "Reference to the gitaly package";
|
||||
};
|
||||
|
||||
packages.pages = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.gitlab-pages;
|
||||
defaultText = "pkgs.gitlab-pages";
|
||||
description = "Reference to the gitlab-pages package";
|
||||
};
|
||||
|
||||
statePath = mkOption {
|
||||
type = types.str;
|
||||
default = "/var/gitlab/state";
|
||||
|
@ -451,6 +463,12 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
pagesExtraArgs = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ "-listen-proxy" "127.0.0.1:8090" ];
|
||||
description = "Arguments to pass to the gitlab-pages daemon";
|
||||
};
|
||||
|
||||
secrets.secretFile = mkOption {
|
||||
type = with types; nullOr path;
|
||||
default = null;
|
||||
|
@ -754,6 +772,26 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
systemd.services.gitlab-pages = mkIf (gitlabConfig.production.pages.enabled or false) {
|
||||
description = "GitLab static pages daemon";
|
||||
after = [ "network.target" "redis.service" "gitlab.service" ]; # gitlab.service creates configs
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
path = [ pkgs.unzip ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
TimeoutSec = "infinity";
|
||||
Restart = "on-failure";
|
||||
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
|
||||
ExecStart = "${cfg.packages.pages}/bin/gitlab-pages ${escapeShellArgs pagesArgs}";
|
||||
WorkingDirectory = gitlabEnv.HOME;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.gitlab-workhorse = {
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue