nix/nixos/hosts/nixos-rpi4-03/temp.nix

29 lines
975 B
Nix
Raw Normal View History

2023-10-07 14:50:22 +02:00
{pkgs, lib, config, ...}: {
2023-10-08 10:34:07 +02:00
networking.firewall.interfaces.wireguard0.allowedTCPPorts = [ 80 443 ];
2023-10-07 14:50:22 +02:00
2023-10-09 03:34:14 +02:00
# Generate a test cert
# sudo openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 \
# -nodes -keyout test-ssl.key -out test-ssl.crt -subj "/CN=test-ssl" \
# -addext "subjectAltName=DNS:test-ssl,DNS:*.test-ssl,IP:10.100.0.2"
2023-10-09 03:31:53 +02:00
2023-10-07 14:50:22 +02:00
services.nginx = {
enable = true;
2023-10-08 03:13:09 +02:00
httpConfig = ''
index index.html;
server {
listen 80 default_server;
server_name _;
server_name_in_redirect off;
2023-10-08 03:44:41 +02:00
root /var/www/test;
2023-10-08 03:13:09 +02:00
}
2023-10-09 03:31:53 +02:00
server {
listen 443 ssl;
server_name _;
server_name_in_redirect off;
root /var/www/test-ssl;
ssl_certificate /etc/ssl/nginx/test-ssl.crt;
ssl_certificate_key /etc/ssl/nginx/test-ssl.key;
}
2023-10-08 03:13:09 +02:00
'';
2023-10-07 14:50:22 +02:00
};
2023-10-07 14:52:10 +02:00
}