-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbench.nix
56 lines (50 loc) · 1.19 KB
/
bench.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
{ lib, pkgs, ... }: {
environment.systemPackages = with pkgs; [
psrecord
static-html
];
system.activationScripts = {
pristine = ''
${pkgs.systemd}/bin/systemctl stop nginx caddy || true
'';
};
systemd.services.static-html = {
wantedBy = [ "nginx.service" "caddy.service" ];
script = ''
ln -sf ${pkgs.static-html} /srv/static
'';
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
};
networking.firewall.allowedTCPPorts = [ 8080 ];
services.caddy = {
enable = true;
configFile = ./Caddyfile;
};
systemd.services.caddy = {
serviceConfig.LimitNOFILE = "250000:250000";
wantedBy = lib.mkForce [];
};
services.nginx = {
enable = true;
logError = "/dev/null";
config = builtins.readFile ./nginx.conf;
};
systemd.services.nginx = {
serviceConfig.LimitNOFILE = "250000:250000";
wantedBy = lib.mkForce [];
};
services.lighttpd = let
luaScript = ./synthetic.lua;
in {
enable = true;
port = 8081;
enableModules = [ "mod_magnet" ];
document-root = "${pkgs.static-html}";
extraConfig = ''
magnet.attract-physical-path-to = ( "${luaScript}" )
'';
};
}