mirror of
https://github.com/kp2pml30/dotfiles.git
synced 2026-02-17 07:44:41 +04:00
first xray
This commit is contained in:
parent
bbacfb100e
commit
c2106ca1a6
18 changed files with 482 additions and 29 deletions
21
nix/server/xray.nix
Normal file
21
nix/server/xray.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.kp2pml30.server;
|
||||
ports = config.kp2pml30.server.ports;
|
||||
in lib.mkIf cfg.xray {
|
||||
services.xray = {
|
||||
enable = true;
|
||||
settingsFile = "/run/secrets/xray-config.json";
|
||||
};
|
||||
|
||||
# Ensure xray can read the certificates
|
||||
users.users.xray.extraGroups = [ "nginx" ];
|
||||
|
||||
# Ensure the xray service starts after ACME certificates are available
|
||||
systemd.services.xray.after = [ "acme-${cfg.hostname}.service" ];
|
||||
systemd.services.xray.wants = [ "acme-${cfg.hostname}.service" ];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue