the configuration for all my nixos machines (hacky! bad! ugly!)
1{config, lib, pkgs, inputs, ...}:
2let cfg = config.profiles.ssh;
3in {
4 options.profiles.ssh.enable =
5 lib.mkEnableOption "SSH configuration (keys not included)";
6 config = lib.mkIf cfg.enable {
7 services.ssh-agent.enable = true;
8 programs.ssh = {
9 enable = true;
10 enableDefaultConfig = false;
11 matchBlocks = {
12 "*" = {
13 addKeysToAgent = "yes";
14 identitiesOnly = true;
15 };
16 anubis = {
17 hostname = "anubis.bahamut.monster";
18 user = "root";
19 identityFile = "~/.ssh/id_ed25519";
20 forwardAgent = true;
21 };
22 uruk = {
23 user = "joshua";
24 identityFile = "~/.ssh/id_ed25519";
25 forwardAgent = true;
26 };
27 github = {
28 hostname = "github.com";
29 user = "git";
30 identityFile = "~/.ssh/id_ed25519";
31 };
32 tangled = {
33 hostname = "tangled.org";
34 user = "git";
35 identityFile = "~/.ssh/id_ed25519";
36 };
37 };
38 };
39 };
40}