1 { pkgs, lib, config, hosts, hostName, ... }:
5 settings.X11Forwarding = true;
7 systemd.services.sshd.serviceConfig.LoadCredentialEncrypted = [
8 "host.key:${ssh/host.key.cred}"
15 security.initrd.secrets."${hostName}/ssh/initrd.key" =
16 "hosts/${hostName}/ssh/initrd.key.gpg";
17 boot.initrd.network.ssh = {
20 authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
21 hostKeys = [ "${config.security.initrd.stage1Dir}/${hostName}/ssh/initrd.key" ];
26 systemd.services.ssh-mermet-reverse = {
27 after = [ "network-online.target" ];
28 wantedBy = [ "multi-user.target" ];
31 # Require services.openssh.gatewayPorts = "clientspecified";
33 ExecStart = ''${pkgs.openssh}/bin/ssh -v -g -N -T \
34 -o ServerAliveInterval=10 \
35 -o ExitOnForwardFailure=yes \
36 -R *:10022:localhost:22 \
37 ${hosts.mermet._module.args.ipv4}
43 services.upnpc.enable = true;
44 services.upnpc.redirections =
51 service.wantedBy = [ "sshd.service" ];
52 service.partOf = [ "sshd.service" ];
54 { description = "Mosh"; externalPort = 60000; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
55 { description = "Mosh"; externalPort = 60001; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
56 { description = "Mosh"; externalPort = 60002; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
57 { description = "Mosh"; externalPort = 60003; protocol = "UDP"; duration = 30 * 60; service.wantedBy = [ "sshd.service" ]; }
60 description = "SSH (boot)";
64 service.wantedBy = [ "sshd.service" ];