nix-configs

Personal NixOS and home-manager configuration files
Log | Files | Refs

ssh.nix (1121B)


      1 { domain, username, ... }:
      2 
      3 {
      4 	programs.ssh = {
      5 		enable = true;
      6 
      7 		matchBlocks = {
      8 			"minskio" = {
      9 				hostname = "${domain}";
     10 				user = "${username}";
     11 				port = 55012;
     12 				identityFile = "~/vault/docs/secure/ssh-key-2022-02-16.key";
     13 			};
     14 			"tunnel" = {
     15 				hostname = "${domain}";
     16 				user = "${username}";
     17 				port = 55012;
     18 				identityFile = "~/vault/docs/secure/ssh-key-2022-02-16.key";
     19 				extraOptions = {
     20 					RemoteCommand = "ssh -p 55013 ${username}@localhost -i ~/vault/docs/secure/ssh-key-2022-02-16.key";
     21 					RequestTTY = "force";
     22 					};
     23 			};
     24 			"htpc" = {
     25 				hostname = "192.168.1.6";
     26 				user = "${username}";
     27 				port = 22;
     28 				identityFile = "~/vault/docs/secure/ssh-key-2022-02-16.key";
     29 			};
     30 			"nas" = {
     31 				hostname = "192.168.1.3";
     32 				user = "${username}";
     33 				port = 22;
     34 				identityFile = "~/vault/docs/secure/ssh-key-2022-02-16.key";
     35 			};
     36 			"router" = {
     37 				hostname = "192.168.1.1";
     38 				user = "root";
     39 				port = 22;
     40 			};
     41 			"ap" = {
     42 				hostname = "192.168.1.2";
     43 				user = "root";
     44 				port = 22;
     45 				extraOptions = {
     46 					HostKeyAlgorithms = "+ssh-rsa";
     47 					};
     48 			};
     49 		};
     50 	};
     51 
     52 }