-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebsite.nix
48 lines (39 loc) · 1.16 KB
/
website.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ config, pkgs, lib, ... }:
{
# Enable nginx and adjust firewall rules.
services.nginx.enable = true;
networking.firewall.allowedTCPPorts = [ 80 443 25565 ];
networking.firewall.allowedUDPPorts = [ 25565 ];
# Set a few recommended defaults.
#services.nginx = {
# recommendedGzipSettings = true;
# recommendedOptimisation = true;
# recommendedProxySettings = true;
# recommendedTlsSettings = true;
#};
# Add some hosting/Drupal specific packages.
environment.systemPackages = with pkgs; [
nodejs
yarn
];
# nginx server
services.nginx.virtualHosts."joewang.me" = {
addSSL = true;
enableACME = true;
root = "/var/website";
#extraConfig = ''
# index index.html
#'';
};
security.acme = {
acceptTerms = true;
defaults.email = "joewangzz1028@gmail.com";
};
# /var/lib/acme/.challenges must be writable by the ACME user
# and readable by the Nginx user. The easiest way to achieve
# this is to add the Nginx user to the ACME group.
#users.users.nginx.extraGroups = [ "acme" ];
# Optionally add some environment variables.
# environment.variables = {
# PLATFORM = "production";
}