From 3ed52c78047bcc4b74d34e0cee179bb708aebdc0 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Mon, 5 Nov 2018 21:05:42 -0500 Subject: [PATCH] nixos/gitea: add mysql socket authentication as an option --- nixos/modules/services/misc/gitea.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/gitea.nix b/nixos/modules/services/misc/gitea.nix index 16a4a806202..7a10bd87299 100644 --- a/nixos/modules/services/misc/gitea.nix +++ b/nixos/modules/services/misc/gitea.nix @@ -15,7 +15,7 @@ let [database] DB_TYPE = ${cfg.database.type} - HOST = ${cfg.database.host}:${toString cfg.database.port} + HOST = ${if cfg.database.socket != null then cfg.database.socket else cfg.database.host + ":" + toString cfg.database.port} NAME = ${cfg.database.name} USER = ${cfg.database.user} PASSWD = #dbpass# @@ -149,6 +149,13 @@ in ''; }; + socket = mkOption { + type = types.nullOr types.path; + default = null; + example = "/run/mysqld/mysqld.sock"; + description = "Path to the unix socket file to use for authentication."; + }; + path = mkOption { type = types.str; default = "${cfg.stateDir}/data/gitea.db";