perf: Home-manager to module

feat: Optionise config
This commit is contained in:
2025-02-02 14:57:36 +03:00
parent f2c215460b
commit ea39ab9992
97 changed files with 395 additions and 488 deletions

28
modules/host/vpn.nix Normal file
View File

@ -0,0 +1,28 @@
{pkgs, config, ...}: {
systemd.services.v2raya = {
enable = true;
description = "v2rayA gui client";
after = [ "network.target" ];
serviceConfig = {
Restart = "always";
ExecStart = "${pkgs.v2raya}/bin/v2rayA";
};
path = with pkgs; [ iptables bash iproute2 ];
wantedBy = [ "multi-user.target" ];
environment = {
V2RAYA_LOG_FILE = "/var/log/v2raya/v2raya.log";
V2RAY_LOCATION_ASSET = "/etc/v2raya";
XRAY_LOCATION_ASSET = "/etc/v2raya";
};
};
environment.etc = {
"v2raya/ru_geoip.dat".source = pkgs.fetchurl {
name = "geoip.dat";
url = "https://github.com/runetfreedom/russia-blocked-geoip/releases/download/202501260919/geoip.dat";
hash = "sha256-OZoWEyfp1AwIN1eQHaB5V3FP51gsUKKDbFBHtqs4UDM=";
};
"v2raya/bolt.db".source = config.sops.secrets.vpn_bolt.path;
};
}