blob: 9cef7ff4c326864dc3590a60dc032e91cec6f112 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
{
config,
lib,
pkgs,
...
}:
let
cfg = config.seth.programs.ssh;
in
{
options.seth.programs.ssh = {
enable = lib.mkEnableOption "SSH configuration" // {
default = config.seth.enable;
defaultText = lib.literalExpression "config.seth.enable";
};
};
config = lib.mkIf cfg.enable {
programs.ssh = {
enable = true;
package = pkgs.openssh;
matchBlocks =
let
sshDir = "${config.home.homeDirectory}/.ssh";
in
{
# git forges
"codeberg.org" = {
identityFile = "${sshDir}/codeberg";
user = "git";
};
"github.com" = {
identityFile = "${sshDir}/github";
user = "git";
};
# linux packaging
"aur.archlinux.org" = {
identityFile = "${sshDir}/aur";
user = "aur";
};
"pagure.io" = {
identityFile = "${sshDir}/copr";
user = "git";
};
# macstadium m1
"mini.scrumplex.net" = {
identityFile = "${sshDir}/macstadium";
user = "bob-the-builder";
};
# router
"192.168.1.1" = {
identityFile = "${sshDir}/openwrt";
user = "root";
};
# servers
"atlas".user = "atlas";
};
};
services.ssh-agent.enable = pkgs.stdenv.isLinux;
};
}
|