1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00
Files
niveum/configs/ssh.nix

107 lines
2.7 KiB
Nix
Raw Permalink Normal View History

2022-03-10 21:52:12 +01:00
{
pkgs,
config,
lib,
...
}: let
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}";
2019-04-19 03:11:51 +02:00
in {
users.users.me.openssh.authorizedKeys.keys = kieran.sshKeys pkgs;
2019-04-19 03:11:51 +02:00
2023-03-11 06:36:22 +01:00
home-manager.users.me = {
services.gpg-agent = rec {
enable = true;
enableSshSupport = true;
defaultCacheTtlSsh = 2 * 60 * 60;
maxCacheTtlSsh = 4 * defaultCacheTtlSsh;
sshKeys = [
"568047C91DE03A23883E340F15A9C24D313E847C"
2023-03-12 18:26:58 +01:00
"BB3EE102DB8CD45540A78A6B18B511B67061F6B4" # kfm@manakish ed25519
"3F8986755818B5762A096BE212777EAAC441DD9D" # fysiweb rsa
"0E4ABD229432486CC432639BB0986B2CDE365105" # agenix ed25519
2023-03-20 12:23:49 +01:00
"A1E8D32CBFCDBD2DE798E2298D795CCFD785AE06" # kfm@kabsa ed25519
2023-03-11 06:36:22 +01:00
];
};
};
2023-03-12 18:26:58 +01:00
environment.extraInit = ''
if [[ -z "$SSH_AUTH_SOCK" ]]; then
export SSH_AUTH_SOCK="$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)"
fi
'';
environment.interactiveShellInit = ''
GPG_TTY="$(tty)"
export GPG_TTY
${pkgs.gnupg}/bin/gpg-connect-agent updatestartuptty /bye > /dev/null
'';
2019-04-19 03:11:51 +02:00
home-manager.users.me.programs.ssh = {
enable = true;
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 = {
hostname = "zaatar.r";
2020-10-31 20:51:25 +01:00
user = "root";
port = sshPort;
};
makanek = {
hostname = externalNetwork.makanek;
user = "root";
port = sshPort;
};
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";
};
${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
};
};
}