Skip to content

Commit 2b8b53d

Browse files
committed
Configure SSH to use 1Password's ssh-agent
1 parent 4f769de commit 2b8b53d

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

modules/profiles/home/gnupg/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
home.file.".gnupg/gpg-agent.conf".source = ./gpg-agent.conf;
4646

4747
# This has to be set here, even though gpg-agent in nix-darwin should be able to set it
48-
home.sessionVariables.SSH_AUTH_SOCK =
49-
"$(${lib.getExe' pkgs.gnupg "gpgconf"} --list-dirs agent-ssh-socket)";
48+
# home.sessionVariables.SSH_AUTH_SOCK =
49+
# "$(${lib.getExe' pkgs.gnupg "gpgconf"} --list-dirs agent-ssh-socket)";
5050

5151
programs.fish.functions = let
5252
gpg = lib.getExe' config.programs.gpg.package "gpg";
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
# programs.ssh = {
3+
# enable = true;
4+
# extraConfig = ''
5+
# IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
6+
# '';
7+
# };
8+
9+
xdg.configFile."../.ssh/config".text = ''
10+
Host *
11+
IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
12+
'';
13+
14+
xdg.configFile."1Password/ssh/agent.toml".text = ''
15+
[[ssh-keys]]
16+
item = "Personal"
17+
vault = "Private"
18+
'';
19+
}

modules/suites/home.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ with profiles;
1616
paths.default
1717
navi.default
1818
rippkgs.default
19+
ssh.default
1920
starship.default
2021
tmux.default
2122
tools.common

0 commit comments

Comments
 (0)