mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 15:04:59 +08:00
systtemd
This commit is contained in:
parent
e0df153079
commit
00846d03e8
1 changed files with 18 additions and 2 deletions
|
|
@ -91,8 +91,7 @@ in
|
|||
};
|
||||
|
||||
# SOCKS5 proxy via SSH tunnel to jump host
|
||||
# TODO: Linux systemd service
|
||||
launchd.agents.juspay-socks5-proxy = lib.mkIf cfg.socks5Proxy.enable {
|
||||
launchd.agents.juspay-socks5-proxy = lib.mkIf (cfg.socks5Proxy.enable && pkgs.stdenv.isDarwin) {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [
|
||||
|
|
@ -110,5 +109,22 @@ in
|
|||
StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/socks5-proxy.err";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.juspay-socks5-proxy = lib.mkIf (cfg.socks5Proxy.enable && pkgs.stdenv.isLinux) {
|
||||
Unit = {
|
||||
Description = "SOCKS5 proxy via SSH tunnel to Juspay jump host";
|
||||
After = [ "network.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
ExecStart = "${pkgs.openssh}/bin/ssh -D ${toString cfg.socks5Proxy.port} -N -C ${cfg.jumpHost}";
|
||||
Restart = "always";
|
||||
RestartSec = "10s";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue