applications.server.acme: defaults + persists state

This commit is contained in:
eyjhb 2024-08-08 19:38:02 +02:00
parent 7cee029fff
commit f792e23584
No known key found for this signature in database
GPG key ID: 609F508E3239F920
3 changed files with 24 additions and 8 deletions

View file

@ -6,6 +6,7 @@ in {
imports = [ imports = [
./../shared ./../shared
./../shared/applications/server/acme.nix
./../shared/applications/server/nginx.nix ./../shared/applications/server/nginx.nix
./../shared/applications/state/ssh.nix ./../shared/applications/state/ssh.nix

View file

@ -0,0 +1,23 @@
{ config, lib, ... }:
{
# default acme settings
security.acme = {
acceptTerms = true;
defaults.email = "fricloudacme.cameo530@simplelogin.com";
};
# give Nginx access to our certs
services.nginx.group = config.security.acme.defaults.group;
# acme user
users.groups."${config.security.acme.defaults.group}".members = [];
# state
environment.persistence = lib.optionalAttrs config.mine.state.enable {
root.directories = [
"/var/lib/acme"
];
};
}

View file

@ -10,9 +10,6 @@ let
-out "$out/ca.pem" -keyout "$out/ca.key" -out "$out/ca.pem" -keyout "$out/ca.key"
''; '';
in { in {
security.acme.defaults.email = "fricloudacme.cameo530@simplelogin.com";
security.acme.acceptTerms = true;
services.nginx = { services.nginx = {
enable = true; enable = true;
@ -25,9 +22,6 @@ in {
# only allow PFS-enabled ciphers with AES256 # only allow PFS-enabled ciphers with AES256
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL"; sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
# give Nginx access to our certs
group = "acme";
# setup a default site # setup a default site
virtualHosts.default = { virtualHosts.default = {
default = lib.mkDefault true; default = lib.mkDefault true;
@ -49,8 +43,6 @@ in {
}; };
}; };
users.groups.acme = {};
networking.firewall = { networking.firewall = {
allowedTCPPorts = [80 443]; allowedTCPPorts = [80 443];
allowedUDPPorts = [443]; allowedUDPPorts = [443];