-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
90 lines (79 loc) · 1.95 KB
/
configuration.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{ config, pkgs, ... }:
{
imports = [ <nixpkgs/nixos/modules/virtualisation/google-compute-image.nix> ];
environment.systemPackages = with pkgs; [
vim wget htop git
];
time.timeZone = "Asia/Hong_Kong";
security.sudo.wheelNeedsPassword = false;
users.extraUsers = {
acsoc = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
boris = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
};
services = {
openssh = {
enable = true;
passwordAuthentication = true;
};
mysql = {
enable = true;
package = pkgs.mysql;
dataDir = "/var/db/mysql";
};
phpfpm = {
pools = {
default = {
listen = "127.0.0.1:9000";
extraConfig = ''
user = nobody
pm = dynamic
pm.max_children = 75
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 500
'';
};
};
};
nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
virtualHosts = {
"index.0x9b.moe" = {
#serverAliases = [ "index.0x9b.moe" ];
default = true;
enableACME = true;
enableSSL = true;
forceSSL = true;
root = "/data/index/www";
locations = {
"/" = {
tryFiles = "$uri @php";
};
"@php" = {
extraConfig = ''
rewrite (.*) /index.php?$1 last;
'';
};
"~ \.php$" = {
extraConfig = ''
include ${pkgs.nginx}/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
'';
};
};
};
};
};
};
}