forward x11 and wayland

This commit is contained in:
Charlotte 🦝 Delenk 2024-11-21 09:49:24 +01:00
parent e48c086eb6
commit 249ea2632d
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
4 changed files with 38 additions and 0 deletions

View file

@ -34,7 +34,15 @@
bind.address = "/%d/.local/state/gnupg/S.gpg-agent"; bind.address = "/%d/.local/state/gnupg/S.gpg-agent";
host.address = "/%d/.local/state/gnupg/S.gpg-agent.extra"; host.address = "/%d/.local/state/gnupg/S.gpg-agent.extra";
} }
{
bind.address = "/%d/.local/state/waypipe/server.sock";
host.address = "/%d/.local/state/waypipe/client.sock";
}
]; ];
forwardX11 = true;
forwardX11Trusted = true;
setEnv.WAYLAND_DISPLAY = "wayland-waypipe";
extraOptions.StreamLocalBindUnlink = "yes";
}; };
enable = true; enable = true;
}; };

View file

@ -3,5 +3,6 @@
imports = [ imports = [
./kdeconnect.nix ./kdeconnect.nix
./gpg ./gpg
./waypipe.nix
]; ];
} }

View file

@ -0,0 +1,25 @@
{ pkgs, lib, ... }:
{
home.packages = [ pkgs.waypipe ];
systemd.user.services = {
waypipe-client = {
Unit.Description = "Runs waypipe on startup to support SSH forwarding";
Service = {
ExecStartPre = "${lib.getExe' pkgs.coreutils "mkdir"} %h/.waypipe -p";
ExecStart = "${lib.getExe pkgs.waypipe} --socket %h/.local/state/waypipe/client.sock client";
ExecStopPost = "${lib.getExe' pkgs.coreutils "rm"} -f %h/.local/state/waypipe/client.sock";
};
Install.WantedBy = [ "graphical-session.target" ];
};
waypipe-server = {
Unit.Description = "Runs waypipe on startup to support SSH forwarding";
Service = {
Type = "simple";
ExecStartPre = "${lib.getExe' pkgs.coreutils "mkdir"} %h/.waypipe -p";
ExecStart = "${lib.getExe pkgs.waypipe} --socket %h/.local/state/waypipe/server.sock --title-prefix '[%H] ' --login-shell --display wayland-waypipe server -- ${lib.getExe' pkgs.coreutils "sleep"} infinity";
ExecStopPost = "${lib.getExe' pkgs.coreutils "rm"} -f %h/.local/state/waypipe/server.sock %t/wayland-waypipe";
};
Install.WantedBy = [ "default.target" ];
};
};
}

View file

@ -4,6 +4,10 @@
services.openssh.settings = { services.openssh.settings = {
PermitRootLogin = "yes"; PermitRootLogin = "yes";
PasswordAuthentication = false; PasswordAuthentication = false;
StreamLocalBindUnlink = "yes";
GatewayPorts = "clientspecified";
AcceptEnv = "WAYLAND_DISPLAY";
X11Forwarding = true;
}; };
programs.ssh.knownHosts = { programs.ssh.knownHosts = {
"git.chir.rs".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE+GanuiV1I08OP8+nNy24+zagQN08rtJnCoU/ixiQNn"; "git.chir.rs".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE+GanuiV1I08OP8+nNy24+zagQN08rtJnCoU/ixiQNn";