gitea email support
This commit is contained in:
parent
3d16556312
commit
c234acacec
@ -1,4 +1,9 @@
|
|||||||
{ lib, config, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.my.servers.gitea;
|
cfg = config.my.servers.gitea;
|
||||||
setup = import ./setup.nix { inherit lib config; };
|
setup = import ./setup.nix { inherit lib config; };
|
||||||
@ -8,16 +13,16 @@ in
|
|||||||
config.services = {
|
config.services = {
|
||||||
gitea = lib.mkIf cfg.enable {
|
gitea = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
appName = "Danilo Git";
|
|
||||||
domain = cfg.host;
|
domain = cfg.host;
|
||||||
rootUrl = cfg.url;
|
rootUrl = cfg.url;
|
||||||
settings = {
|
settings = {
|
||||||
session.COOKIE_SECURE = true;
|
session.COOKIE_SECURE = true;
|
||||||
server = {
|
server.HTTP_PORT = cfg.port;
|
||||||
HTTP_PORT = cfg.port;
|
mailer = {
|
||||||
START_SSH_SERVER = true;
|
ENABLED = true;
|
||||||
SSH_PORT = 2222;
|
MAILER_TYPE = "sendmail";
|
||||||
SSH_LISTEN_PORT = 2222;
|
FROM = config.my.smtpemail;
|
||||||
|
SENDMAIL_PATH = "${pkgs.msmtp}/bin/msmtp";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
database = {
|
database = {
|
||||||
|
|||||||
@ -40,12 +40,9 @@ in
|
|||||||
go-vod.enable = lib.mkEnableOption "enable";
|
go-vod.enable = lib.mkEnableOption "enable";
|
||||||
};
|
};
|
||||||
config = lib.mkIf (cfg.enable && config.my.servers.postgres.enable) {
|
config = lib.mkIf (cfg.enable && config.my.servers.postgres.enable) {
|
||||||
sops.secrets = {
|
sops.secrets.nextcloud-adminpass = {
|
||||||
smtp-password = { };
|
owner = config.users.users.nextcloud.name;
|
||||||
nextcloud-adminpass = {
|
inherit (config.users.users.nextcloud) group;
|
||||||
owner = config.users.users.nextcloud.name;
|
|
||||||
inherit (config.users.users.nextcloud) group;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
nixpkgs.config.permittedInsecurePackages = [
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
"nodejs-14.21.3"
|
"nodejs-14.21.3"
|
||||||
@ -64,18 +61,6 @@ in
|
|||||||
;
|
;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.msmtp = {
|
|
||||||
enable = true;
|
|
||||||
accounts.default = {
|
|
||||||
auth = true;
|
|
||||||
host = "smtp.gmail.com";
|
|
||||||
port = 587;
|
|
||||||
tls = true;
|
|
||||||
from = config.my.smtpemail;
|
|
||||||
user = config.my.smtpemail;
|
|
||||||
passwordeval = "cat ${config.sops.secrets.smtp-password.path}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services = {
|
services = {
|
||||||
nextcloud = {
|
nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
25
modules/services/msmtp.nix
Normal file
25
modules/services/msmtp.nix
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.my.servers;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.nextcloud.enable or cfg.gitea.enable {
|
||||||
|
sops.secrets.smtp-password = { };
|
||||||
|
programs.msmtp = {
|
||||||
|
enable = true;
|
||||||
|
accounts.default = {
|
||||||
|
auth = true;
|
||||||
|
host = "smtp.gmail.com";
|
||||||
|
port = 587;
|
||||||
|
tls = true;
|
||||||
|
from = config.my.smtpemail;
|
||||||
|
user = config.my.smtpemail;
|
||||||
|
passwordeval = "cat ${config.sops.secrets.smtp-password.path}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user