Skip to content

Commit 607694d

Browse files
committed
chore: add nixops ssh wrapper scripts
- add utilities for measuring resource usage - use root nginx location for nixops
1 parent d65e97f commit 607694d

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

nix/nginx/conf/custom.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
location / {
2+
echo 'Hello world';
3+
}
4+
15
location /slow-reply {
26
echo_sleep 2;
37
echo 'this text will come in response body with HTTP 200 after 2 seconds';

nix/nginx/conf/nginx.conf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ http {
1414
server {
1515
listen 8080;
1616

17-
location / {
18-
echo 'Hello world';
19-
}
20-
2117
include custom.conf;
2218
}
2319

nix/nixops.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ in {
126126
};
127127

128128
environment.systemPackages = [
129+
pkgs.bcc
130+
pkgs.pgmetrics
131+
pkgs.pg_activity
132+
pkgs.htop
129133
pkgs.vegeta
130134
(
131135
pkgs.writeShellScriptBin "vegeta-bench" ''

nix/nixopsScripts.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ let
3030
3131
${nixopsBin} ssh -d pg_net client
3232
'';
33+
nixopsSSHServer =
34+
writeShellScriptBin ("net-cloud-ssh-server")
35+
''
36+
set -euo pipefail
37+
38+
cd nix
39+
40+
${nixopsBin} ssh -d pg_net server
41+
'';
3342
nixopsReproTimeouts =
3443
writeShellScriptBin ("net-cloud-reproduce-timeouts")
3544
''
@@ -50,10 +59,21 @@ let
5059
5160
${nixopsBin} delete -d pg_net
5261
'';
62+
nixopsInfo =
63+
writeShellScriptBin ("net-cloud-info")
64+
''
65+
set -euo pipefail
66+
67+
cd nix
68+
69+
${nixopsBin} info
70+
'';
5371
in
5472
[
5573
nixopsDeploy
5674
nixopsSSH
75+
nixopsSSHServer
5776
nixopsReproTimeouts
5877
nixopsDestroy
78+
nixopsInfo
5979
]

0 commit comments

Comments
 (0)