Updated services logic

This commit is contained in:
Illia Chub 2020-12-21 12:55:36 +02:00
parent 1e3176e777
commit b2ccc9be90

View file

@ -138,42 +138,37 @@ EOF
{ pkgs, ... }: { pkgs, ... }:
{ {
users.groups.acmerecievers = { users.groups.acmerecievers = {
members = [ "nginx" "dovecot2" "postfix" "virtualMail" "ocserv" ]; members = [ "nginx" "dovecot2" "postfix" "virtualMail" "bitwarden_rs" "nextcloud" "uwsgi" ];
}; };
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
email = "$USER@$DOMAIN"; email = "$USER@$DOMAIN";
certs."$DOMAIN" = { certs = {
"$DOMAIN" = {
group = "acmerecievers"; group = "acmerecievers";
}; };
"git.$DOMAIN" = {
group = "acmerecievers";
};
"cloud.$DOMAIN" = {
group = "acmerecievers";
};
"password.$DOMAIN" = {
group = "acmerecievers";
};
"api.$DOMAIN" = {
group = "acmerecievers";
};
"meet.$DOMAIN" = {
group = "acmerecievers";
};
};
}; };
} }
EOF EOF
mkdir -p /etc/nixos/letsencrypt mkdir -p /etc/nixos/letsencrypt
cat > /etc/nixos/letsencrypt/acme.nix << EOF cat > /etc/nixos/letsencrypt/certbot.nix << EOF
{ pkgs, ... }:
{
systemd = {
timers.certbot-renew = {
wantedBy = [ "timers.target" ];
partOf = [ "certbot-renew.service" ];
timerConfig.OnCalendar = "monthly";
};
services.certbot-renew = {
path = with pkgs; [
letsencrypt
];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.letsencrypt}/bin/certbot renew";
};
};
};
}
EOF
cat > /etc/nixos/letsencrypt/acme.nix << EOF
{ pkgs, ... }: { pkgs, ... }:
{ {
systemd = { systemd = {
@ -399,27 +394,23 @@ EOF
httpAddress = "0.0.0.0"; httpAddress = "0.0.0.0";
httpPort = 3000; httpPort = 3000;
cookieSecure = true; cookieSecure = true;
extraConfig = '' settings = {
[mailer] mailer = {
ENABLED = false ENABLED = false;
};
[ui] ui = {
DEFAULT_THEME = arc-green DEFAULT_THEME = "arc-green";
};
[ui.meta] picture = {
AUTHOR = $NAME $SURNAME DISABLE_GRAVATAR = true;
DESCRIPTION = $NAME's Personal Git Repository };
KEYWORDS = development admin = {
ENABLE_KANBAN_BOARD = true;
[picture] };
DISABLE_GRAVATAR = true repository = {
FORCE_PRIVATE = false;
[admin] };
ENABLE_KANBAN_BOARD = true };
[repository]
FORCE_PRIVATE = false
'';
}; };
}; };
} }