decouple vpn and proxies
This commit is contained in:
parent
1518f7007b
commit
476c13d296
13 changed files with 103 additions and 45 deletions
23
m/vpn/shadowsocks.nix
Normal file
23
m/vpn/shadowsocks.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.maid.proxies;
|
||||
in
|
||||
{
|
||||
options.maid.proxies = {
|
||||
yor = {
|
||||
enable = lib.mkEnableOption "Yor shadowsocks proxy";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.yor.enable {
|
||||
systemd.services.yor-proxy = {
|
||||
after = [ "network.target" ];
|
||||
description = "`Yor` proxy server";
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = ''${pkgs.shadowsocks-rust}/bin/sslocal --config ${config.sops.secrets."viendesu/shadowsocks/yor".path}'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue