2022-03-10 21:52:12 +01:00
|
|
|
{
|
|
|
|
|
pkgs,
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
2023-02-22 10:02:55 +01:00
|
|
|
inherit (import ../lib) sshPort kieran;
|
|
|
|
|
externalNetwork = import ../lib/external-network.nix;
|
2022-07-06 15:10:47 +02:00
|
|
|
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
|
2022-12-17 10:03:00 +01:00
|
|
|
ssh-passphrase = lib.strings.fileContents <system-secrets/ssh/passphrase>;
|
2019-04-19 03:11:51 +02:00
|
|
|
in {
|
2023-02-22 10:02:55 +01:00
|
|
|
/*
|
|
|
|
|
TODO how do I do this?
|
2022-12-17 10:03:00 +01:00
|
|
|
services.xserver.displayManager.sessionCommands = toString (pkgs.writeScript "ssh-add" ''
|
|
|
|
|
#!${pkgs.expect}/bin/expect -f
|
|
|
|
|
spawn ${pkgs.openssh}/bin/ssh-add
|
|
|
|
|
expect "Enter passphrase for *:"
|
|
|
|
|
send "${ssh-passphrase}\n";
|
|
|
|
|
expect "Identity added: *"
|
|
|
|
|
interact
|
|
|
|
|
'');
|
2023-02-22 10:02:55 +01:00
|
|
|
*/
|
2022-12-17 10:03:00 +01:00
|
|
|
|
|
|
|
|
programs.ssh.startAgent = true;
|
|
|
|
|
|
2020-10-31 20:52:10 +01:00
|
|
|
users.users.me.openssh.authorizedKeys.keys = kieran.sshKeys pkgs;
|
2019-04-19 03:11:51 +02:00
|
|
|
|
|
|
|
|
home-manager.users.me.programs.ssh = {
|
|
|
|
|
enable = true;
|
2022-09-28 15:54:42 +02:00
|
|
|
matchBlocks = rec {
|
2020-07-27 13:38:24 +02:00
|
|
|
"github.com" = {
|
|
|
|
|
hostname = "ssh.github.com";
|
|
|
|
|
port = 443;
|
|
|
|
|
};
|
2020-10-28 21:56:14 +01:00
|
|
|
zaatar = {
|
2020-11-10 22:17:33 +01:00
|
|
|
hostname = "zaatar.r";
|
2020-10-31 20:51:25 +01:00
|
|
|
user = "root";
|
|
|
|
|
port = sshPort;
|
|
|
|
|
};
|
|
|
|
|
makanek = {
|
2022-05-24 11:09:02 +02:00
|
|
|
hostname = externalNetwork.makanek;
|
2022-05-20 23:16:46 +02:00
|
|
|
user = "root";
|
|
|
|
|
port = sshPort;
|
|
|
|
|
};
|
2022-05-24 11:09:02 +02:00
|
|
|
ful = {
|
|
|
|
|
hostname = externalNetwork.ful;
|
2020-10-31 20:51:25 +01:00
|
|
|
user = "root";
|
2019-04-19 03:11:51 +02:00
|
|
|
port = sshPort;
|
|
|
|
|
};
|
2022-03-16 16:04:22 +01:00
|
|
|
tahina = {
|
|
|
|
|
hostname = "tahina.r";
|
|
|
|
|
user = "root";
|
|
|
|
|
port = sshPort;
|
|
|
|
|
};
|
2022-11-25 11:27:43 +01:00
|
|
|
tabula = {
|
|
|
|
|
hostname = "tabula.r";
|
|
|
|
|
user = "root";
|
|
|
|
|
port = sshPort;
|
|
|
|
|
};
|
2020-11-06 10:52:30 +01:00
|
|
|
manakish = {
|
|
|
|
|
hostname = "manakish.r";
|
|
|
|
|
user = "kfm";
|
|
|
|
|
port = sshPort;
|
|
|
|
|
};
|
2021-09-19 09:41:51 +02:00
|
|
|
kabsa = {
|
|
|
|
|
hostname = "kabsa.r";
|
2019-06-15 20:11:39 +02:00
|
|
|
user = "kfm";
|
|
|
|
|
port = sshPort;
|
|
|
|
|
};
|
2021-04-21 11:56:59 +02:00
|
|
|
"nextcloud.fysi.dev" = {
|
|
|
|
|
hostname = "116.203.82.203";
|
|
|
|
|
user = "root";
|
|
|
|
|
};
|
|
|
|
|
"lingua.miaengiadina.ch" = {
|
|
|
|
|
hostname = "135.181.85.233";
|
|
|
|
|
user = "root";
|
|
|
|
|
};
|
2023-02-16 11:53:40 +01:00
|
|
|
"cms-dev.woc2023.app".identityFile = sshIdentity "fysiweb";
|
|
|
|
|
"cms-master.woc2023.app".identityFile = sshIdentity "fysiweb";
|
2022-07-06 15:10:47 +02:00
|
|
|
"fysi-dev1" = {
|
|
|
|
|
hostname = "94.130.229.139";
|
|
|
|
|
user = "root";
|
|
|
|
|
identityFile = sshIdentity "fysiweb";
|
|
|
|
|
};
|
2022-09-28 15:54:42 +02:00
|
|
|
${fysi-dev1.hostname} = fysi-dev1;
|
2022-07-06 15:10:47 +02:00
|
|
|
"fysi-shared0" = {
|
|
|
|
|
hostname = "49.12.205.235";
|
|
|
|
|
user = "root";
|
|
|
|
|
identityFile = sshIdentity "fysiweb";
|
|
|
|
|
};
|
2019-04-19 03:11:51 +02:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|