nix-configs

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

ssh.nix (1005B)


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