nixos/gitea: add support socket connection
This commit is contained in:
parent
1a0e633c60
commit
6a0fd33b4c
@ -206,6 +206,12 @@ in
|
|||||||
description = "HTTP listen port.";
|
description = "HTTP listen port.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableUnixSocket = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Configure Gitea to listen on a unix socket instead of the default TCP port.";
|
||||||
|
};
|
||||||
|
|
||||||
cookieSecure = mkOption {
|
cookieSecure = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@ -306,14 +312,22 @@ in
|
|||||||
ROOT = cfg.repositoryRoot;
|
ROOT = cfg.repositoryRoot;
|
||||||
};
|
};
|
||||||
|
|
||||||
server = {
|
server = mkMerge [
|
||||||
|
{
|
||||||
DOMAIN = cfg.domain;
|
DOMAIN = cfg.domain;
|
||||||
HTTP_ADDR = cfg.httpAddress;
|
|
||||||
HTTP_PORT = cfg.httpPort;
|
|
||||||
ROOT_URL = cfg.rootUrl;
|
|
||||||
STATIC_ROOT_PATH = cfg.staticRootPath;
|
STATIC_ROOT_PATH = cfg.staticRootPath;
|
||||||
LFS_JWT_SECRET = "#jwtsecret#";
|
LFS_JWT_SECRET = "#jwtsecret#";
|
||||||
};
|
ROOT_URL = cfg.rootUrl;
|
||||||
|
}
|
||||||
|
(mkIf cfg.enableUnixSocket {
|
||||||
|
PROTOCOL = "unix";
|
||||||
|
HTTP_ADDR = "/run/gitea/gitea.sock";
|
||||||
|
})
|
||||||
|
(mkIf (!cfg.enableUnixSocket) {
|
||||||
|
HTTP_ADDR = cfg.httpAddress;
|
||||||
|
HTTP_PORT = cfg.httpPort;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
session = {
|
session = {
|
||||||
COOKIE_NAME = "session";
|
COOKIE_NAME = "session";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user