From 601f7cc2a355b4711ddc24b9d46262c3f3784be1 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Mon, 20 Mar 2023 18:06:25 -0600 Subject: home/ssh: initial commit --- home/ssh/default.nix | 20 ++++++++++++++++ home/ssh/match.nix | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 home/ssh/default.nix create mode 100644 home/ssh/match.nix (limited to 'home/ssh') diff --git a/home/ssh/default.nix b/home/ssh/default.nix new file mode 100644 index 0000000..220d18d --- /dev/null +++ b/home/ssh/default.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: +with lib; { + config = { + programs.ssh = mkIf (!config.home.isolation.active) { + enable = true; + + compression = true; + controlMaster = "autoask"; + controlPath = "/run/user/%i/ssh/master-%r@%n:%p"; + + extraOptionOverrides.AddKeysToAgent = "true"; + + matchBlocks = import ./match.nix; + }; + + systemd.user.tmpfiles.rules = [ + "d %t/ssh 0700" + ]; + }; +} diff --git a/home/ssh/match.nix b/home/ssh/match.nix new file mode 100644 index 0000000..45f4f77 --- /dev/null +++ b/home/ssh/match.nix @@ -0,0 +1,66 @@ +{ + "34" = { + hostname = "34project.org"; + port = 2234; + serverAliveInterval = 30; + }; + + "gate.34project.org" = { + serverAliveInterval = 30; + }; + + "hv" = { + user = "admin"; + hostname = "192.168.34.42"; + }; + + "olger.dev" = { + hostname = "201.205.177.184"; + port = 1025; + }; + + "ramips" = { + hostname = "10.34.42.1"; + user = "root"; + }; + + "eric-8100" = { + hostname = "10.34.42.43"; + user = "admin"; + }; + + "hackintosh" = { + hostname = "10.34.42.44"; + user = "ileana"; + }; + + "ramips-lan" = { + hostname = "192.168.34.1"; + user = "root"; + }; + + "xiaomi-lan" = { + hostname = "192.168.42.6"; + user = "u0_a89"; + port = 8022; + }; + + "eric-8100-lan" = { + hostname = "192.168.42.17"; + user = "admin"; + }; + + "github.com" = { + identitiesOnly = true; + identityFile = "~/.ssh/id_rsa"; + user = "git"; + }; + + # Cambiar esto por "itcr3442@github.com" (matchBlocks.*.match aparecerá en 23.05) + "github-itcr" = { + identitiesOnly = true; + identityFile = "~/.ssh/id_klein"; + user = "git"; + hostname = "github.com"; + }; +} -- cgit v1.2.3