tangled
alpha
login
or
join now
encode42.dev
/
nixos
0
fork
atom
Personal-use NixOS configuration
0
fork
atom
overview
issues
pulls
pipelines
Enable GPG agent forwarding
encode42.dev
1 week ago
bfbc1487
9a4919c6
+17
-1
1 changed file
expand all
collapse all
unified
split
homes
encode42
common
ssh.nix
+17
-1
homes/encode42/common/ssh.nix
···
1
1
+
{ osConfig, ... }:
2
2
+
1
3
let
2
4
host = "index";
3
5
address = "192.168.1.2";
6
6
+
7
7
+
agentPath = "/run/user/${toString osConfig.users.users.encode42.uid}/gnupg/S.gpg-agent";
8
8
+
remoteForwards = [
9
9
+
{
10
10
+
bind.address = agentPath;
11
11
+
host.address = agentPath + ".extra";
12
12
+
}
13
13
+
];
4
14
in
5
15
{
16
16
+
services.gpg-agent = {
17
17
+
enableExtraSocket = true;
18
18
+
};
19
19
+
6
20
programs.ssh = {
7
21
enable = true;
8
22
enableDefaultConfig = false;
9
23
10
24
matchBlocks = {
11
25
"index-local" = {
26
26
+
inherit remoteForwards;
27
27
+
12
28
match = "host ${host} exec 'ping -c1 -W0.5 ${address} >/dev/null 2>&1'";
13
29
hostname = address;
14
30
···
16
32
};
17
33
18
34
"index-remote" = {
19
19
-
inherit host;
35
35
+
inherit host remoteForwards;
20
36
21
37
hostname = "encrypted.group";
22
38