1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00

Add acme options

This commit is contained in:
Stefan Ellmauthaler 2022-06-17 19:14:26 +02:00
parent e30ef06cae
commit ac4125af06
Signed by: ellmau
GPG Key ID: C804A9C1B7AF8256
3 changed files with 25 additions and 2 deletions

View File

@ -36,6 +36,7 @@
server = {
enable = true;
nextcloud.enable = true;
acme.staging = true;
};

20
modules/server/acme.nix Normal file
View File

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
with lib;{
options.elss.server.acme.staging = mkEnableOption "Whether to use the staging or the default server for acme";
config =
let
cfg = config.elss.server;
staging = config.elss.server.acme.staging;
in
mkIf cfg.enable {
security.acme = {
defaults = {
server = mkIf staging "https://acme-staging-v02.api.letsencrypt.org/directory";
email = "stefan.ellmauthaler@gmail.com"; # Do not use ellmauthaler.net as the mail server will be covered by acme
};
acceptTerms = true;
};
};
}

View File

@ -7,10 +7,11 @@ with lib; {
options.elss.server.smailserver.enable = mkEnableOption "Set up simple mail server";
imports = [
./acme.nix
./nextcloud.nix
./nginx.nix
./smailserver.nix
./sql.nix
./nextcloud.nix
];
config =
@ -22,6 +23,7 @@ with lib; {
nginx.enable = mkDefault true;
sql.enable = mkDefault true;
smailserver.enable = mkDefault false; # TODO fix simple mail server
nextcloud.enable = mkDefault true;
};
};
}