diff options
Diffstat (limited to 'nix/modules/cgit.nix')
| -rw-r--r-- | nix/modules/cgit.nix | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/nix/modules/cgit.nix b/nix/modules/cgit.nix index eb0cc63..5bf888d 100644 --- a/nix/modules/cgit.nix +++ b/nix/modules/cgit.nix @@ -1,8 +1,11 @@ { lib, config, ... }: +let + serverName = "git.${config.monorepo.vars.orgHost}"; +in { services.cgit."my-projects" = { - enable = lib.mkDefault config.monorepo.profiles.server.enable; - scanPath = "${config.users.users.git.home}"; + enable = lib.mkDefault config.services.gitDaemon.enable; + scanPath = "${config.users.users.git.home}"; settings = { root-title = "Nullring Git Server"; root-desc = "Projects and cool things"; @@ -10,7 +13,7 @@ enable-log-filecount = 1; enable-log-linecount = 1; enable-index-owner = 0; - clone-prefix = "https://git.${config.monorepo.vars.orgHost}"; + clone-prefix = "https://${serverName}"; enable-tree-linenumbers = 1; strict-export = "git-daemon-export-ok"; }; @@ -19,7 +22,13 @@ checkExportOkFiles = true; }; nginx = { - virtualHost = "git.${config.monorepo.vars.orgHost}"; + virtualHost = "${serverName}"; }; }; + + networking.domains.subDomains."${serverName}" = lib.mkIf config.services.cgit."my-projects".enable { }; + services.nginx.virtualHosts."${serverName}" = lib.mkIf config.services.cgit."my-projects".enable { + forceSSL = true; + enableACME = true; + }; } |
