mirror of
https://git.sr.ht/~magic_rb/cluster
synced 2024-11-29 03:26:14 +01:00
4943d08e6b
Signed-off-by: Magic_RB <magic_rb@redalder.org>
79 lines
2 KiB
Nix
79 lines
2 KiB
Nix
nglib:
|
|
(nglib "x86_64-linux").makeSystem {
|
|
system = "x86_64-linux";
|
|
name = "nixng-ingress";
|
|
config = ({ pkgs, config, ... }:
|
|
let
|
|
ids = config.ids;
|
|
in
|
|
{
|
|
config = {
|
|
dumb-init = {
|
|
enable = true;
|
|
sigell = {
|
|
entries = [
|
|
{
|
|
signal = "HUP";
|
|
action = {
|
|
type = "exec";
|
|
environment = {
|
|
PATH = "${pkgs.bash}/bin:${pkgs.busybox}/bin";
|
|
};
|
|
command =
|
|
[ "bash"
|
|
"-c"
|
|
"kill -s HUP \"$(cat /nginx.pid)\""
|
|
];
|
|
};
|
|
}
|
|
{
|
|
signal = "TERM";
|
|
action = {
|
|
type = "signal";
|
|
rewrite = "TERM";
|
|
selector = {
|
|
type = "child";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
type.services = {};
|
|
};
|
|
init.services.nginx = {
|
|
shutdownOnExit = true;
|
|
};
|
|
services.nginx = {
|
|
enable = true;
|
|
envsubst = true;
|
|
configuration = [
|
|
{
|
|
daemon = "off";
|
|
worker_processes = 2;
|
|
user = "nginx";
|
|
|
|
events."" = {
|
|
use = "epoll";
|
|
worker_connections = 128;
|
|
};
|
|
|
|
error_log = [ "/dev/stderr" "warn" ];
|
|
access_log = [ "/dev/stdout" "combined" ];
|
|
|
|
pid = "/nginx.pid";
|
|
|
|
http."" = {
|
|
server_tokens = "off";
|
|
include = [
|
|
[ "${pkgs.nginx}/conf/mime.types" ]
|
|
[ "/local/upstreams.conf" ]
|
|
];
|
|
charset = "utf-8";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
});
|
|
}
|