Added certs

This commit is contained in:
FredzyW 2024-04-08 08:56:16 +02:00
parent 0f939a4fa7
commit c21b049ee1
3 changed files with 25 additions and 0 deletions

View file

@ -92,6 +92,7 @@
home.username = "fw"; home.username = "fw";
home.homeDirectory = "/home/fw"; home.homeDirectory = "/home/fw";
home.stateVersion = "23.11"; # Did you read the comment? home.stateVersion = "23.11"; # Did you read the comment?
systemd.user.startServices = "sd-switch"; systemd.user.startServices = "sd-switch";

View file

@ -11,6 +11,7 @@
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
../../config/users.nix ../../config/users.nix
../../moduler/common/nginx.nix
]; ];
networking.hostName = "server"; networking.hostName = "server";

23
moduler/common/nginx.nix Normal file
View file

@ -0,0 +1,23 @@
{ pkgs, lib, ... }:
{
security.acme = {
acceptTerms = true;
email = "fredrik@wastring.com";
certs."git.wastring.com" = {
dnsProvider = "gandi";
# Supplying password files like this will make your credentials world-readable
# in the Nix store. This is for demonstration purpose only, do not use this in production.
credentialsFile = /home/fw/credentials.sh;
};
};
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."git.wastring.com" = { default = true; enableACME = true; addSSL = true; locations."/".proxyPass = "http://172.17.0.1:3030/"; };
};
}