mirror of
https://github.com/sstent/vmimages.git
synced 2026-01-25 22:51:49 +00:00
addin ssh key
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
|
||||
let cfg = config.custom.ssh-proxy;
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.custom.ssh-proxy;
|
||||
in {
|
||||
options.custom.ssh-proxy = {
|
||||
enable = mkOption {
|
||||
@@ -14,31 +18,28 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
npiperelay
|
||||
socat
|
||||
npiperelay
|
||||
socat
|
||||
];
|
||||
|
||||
systemd.user = {
|
||||
startServices = true;
|
||||
|
||||
systemd.user = {
|
||||
|
||||
startServices = true;
|
||||
|
||||
services.ssh-proxy = {
|
||||
Unit = { Description = "WSL Proxy"; After = "sops-nix.service";};
|
||||
Install = { WantedBy = [ "default.target" ]; };
|
||||
Service = {
|
||||
ExecStart = "${pkgs.writeShellScript "start-proxy" ''
|
||||
set -x -o xtrace # print commands
|
||||
${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
|
||||
''}";
|
||||
services.ssh-proxy = {
|
||||
Unit = {
|
||||
Description = "WSL Proxy";
|
||||
After = "sops-nix.service";
|
||||
};
|
||||
Install = {WantedBy = ["default.target"];};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.writeShellScript "start-proxy" ''
|
||||
set -x -o xtrace # print commands
|
||||
${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
|
||||
''}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user