fixing fitbit

This commit is contained in:
2023-11-30 14:48:39 +00:00
parent 915db56560
commit 4dc8f4b226
13 changed files with 285 additions and 25 deletions

View File

@@ -0,0 +1,45 @@
{
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";
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
''}";
};
};
};
};
}