mirror of
https://github.com/sstent/vmimages.git
synced 2025-12-06 06:01:51 +00:00
sync
This commit is contained in:
43
modules/home-manager/ssh-proxy/default.nix
Normal file
43
modules/home-manager/ssh-proxy/default.nix
Normal file
@@ -0,0 +1,43 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
|
||||
let cfg = config.custom.ssh-proxy;
|
||||
in {
|
||||
options.custom.ssh-proxy = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable ssh-proxy for WSL
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
npiperelay
|
||||
socat
|
||||
];
|
||||
|
||||
|
||||
systemd.user = {
|
||||
|
||||
startServices = true;
|
||||
|
||||
services.ssh-proxy = {
|
||||
Unit = { Description = "WSL Proxy"; };
|
||||
Service = {
|
||||
ExecStart = "${pkgs.writeShellScript "start-proxy" ''
|
||||
# set -x
|
||||
${pkgs.coreutils}/bin/rm -f /home/sstent/.ssh/wsl-ssh-agent.sock
|
||||
${pkgs.util-linux}/bin/setsid ${pkgs.socat}/bin/socat UNIX-LISTEN:/home/sstent/.ssh/wsl-ssh-agent.sock,fork EXEC:"${pkgs.npiperelay}/bin/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork
|
||||
''}";
|
||||
};
|
||||
#Install = { WantedBy = [ "default.target" ]; };
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user