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 = {
group = "acmerecievers"; "$DOMAIN" = {
}; group = "acmerecievers";
}; };
} "git.$DOMAIN" = {
EOF group = "acmerecievers";
};
mkdir -p /etc/nixos/letsencrypt "cloud.$DOMAIN" = {
cat > /etc/nixos/letsencrypt/acme.nix << EOF group = "acmerecievers";
{ pkgs, ... }: };
{ "password.$DOMAIN" = {
systemd = { group = "acmerecievers";
timers.certbot-renew = { };
wantedBy = [ "timers.target" ]; "api.$DOMAIN" = {
partOf = [ "certbot-renew.service" ]; group = "acmerecievers";
timerConfig.OnCalendar = "monthly"; };
}; "meet.$DOMAIN" = {
services.certbot-renew = { group = "acmerecievers";
path = with pkgs; [
letsencrypt
];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.letsencrypt}/bin/certbot renew";
}; };
}; };
}; };
} }
EOF EOF
cat > /etc/nixos/letsencrypt/acme.nix << EOF mkdir -p /etc/nixos/letsencrypt
cat > /etc/nixos/letsencrypt/certbot.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
'';
}; };
}; };
} }