-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy path1password.nix
More file actions
42 lines (39 loc) · 877 Bytes
/
1password.nix
File metadata and controls
42 lines (39 loc) · 877 Bytes
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
{
config,
lib,
pkgs,
...
}:
let
darwinSockPath = "${config.home.homeDirectory}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock";
sockLink = ".1password/agent.sock";
in
{
home.sessionVariables = {
OP_PLUGIN_ALIASES_SOURCED = 1;
};
home.file.sock = lib.mkIf pkgs.stdenvNoCC.isDarwin {
source = config.lib.file.mkOutOfStoreSymlink darwinSockPath;
target = sockLink;
};
programs.ssh = {
enable = true;
matchBlocks = {
"*" = {
identityAgent = "~/.1password/agent.sock";
};
};
};
programs.git = {
signing = {
signByDefault = true;
key = null;
format = "ssh";
signer =
if pkgs.stdenvNoCC.isDarwin then
"/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
else
"${pkgs._1password-gui}/share/1password/op-ssh-sign";
};
};
}