Zapret : Add xray.

This commit is contained in:
Dmitry Voronin 2024-08-30 13:23:15 +03:00
parent ac5c73f7eb
commit f485aa0e1c
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -18,11 +18,30 @@ in {
default = 9150;
type = types.int;
};
xrayport = mkOption {
default = 1081;
type = types.int;
};
storage = mkOption {
default = "${config.container.storage}/zapret";
type = types.str;
};
};
};
config = mkIf cfg.enable {
systemd.tmpfiles.rules = container.mkContainerDir cfg [
"data"
];
containers.zapret = container.mkContainer cfg {
bindMounts = {
"/data" = {
hostPath = "${cfg.storage}/data";
isReadOnly = true;
};
};
config = { ... }: container.mkContainerConfig cfg {
boot.kernel.sysctl = {
"net.ipv4.conf.all.src_valid_mark" = 1;
@ -75,6 +94,11 @@ in {
};
};
};
xray = {
enable = true;
settingsFile = "/data/Client.json";
};
};
systemd = {