Extract gitea domain to variable
This commit is contained in:
@ -1,18 +1,17 @@
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.modules.services.gitea;
|
||||
in {
|
||||
options.modules.services.gitea = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
enable = lib.mkEnableOption "gitea";
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.string;
|
||||
default = "git.vimium.com";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
users = {
|
||||
users.git = {
|
||||
isSystemUser = true;
|
||||
@ -31,7 +30,7 @@ in {
|
||||
};
|
||||
};
|
||||
virtualHosts = {
|
||||
"git.vimium.com" = {
|
||||
"${cfg.domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/".proxyPass = "http://gitea";
|
||||
@ -69,9 +68,9 @@ in {
|
||||
OFFLINE_MODE = true;
|
||||
PROTOCOL = "http+unix";
|
||||
SSH_USER = "git";
|
||||
SSH_DOMAIN = "git.vimium.com";
|
||||
SSH_DOMAIN = "${cfg.domain}";
|
||||
SSH_PORT = lib.head config.services.openssh.ports;
|
||||
ROOT_URL = "https://git.vimium.com/";
|
||||
ROOT_URL = "https://${cfg.domain}/";
|
||||
};
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
session.COOKIE_SECURE = true;
|
||||
|
Reference in New Issue
Block a user