diff --git a/home/default.nix b/home/default.nix index df80dae..c773429 100644 --- a/home/default.nix +++ b/home/default.nix @@ -10,6 +10,7 @@ ./tmux.nix ./neovim.nix ./helix.nix + ./ssh.nix ./starship.nix ./terminal.nix ./nix.nix diff --git a/home/ssh.nix b/home/ssh.nix new file mode 100644 index 0000000..02c1a1f --- /dev/null +++ b/home/ssh.nix @@ -0,0 +1,36 @@ +{ pkgs, ... }: +let + inherit (pkgs) stdenv; + _1passwordAgentSock = + if stdenv.isDarwin then + ''"~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"'' + else + "~/.1password/agent.sock"; +in +{ + programs.ssh = { + enable = true; + matchBlocks = { + "*".extraOptions = { + identityAgent = _1passwordAgentSock; + }; + immediacy = { + hostname = "65.109.35.172"; + user = "srid"; + forwardAgent = true; + }; + biryani = { + hostname = "100.97.32.60"; + user = "admin"; + forwardAgent = true; + }; + # To clone Juspay repos. + # https://developer.1password.com/docs/ssh/agent/advanced/#match-key-with-host + "bitbucket.org" = { + identitiesOnly = true; + identityFile = "~/.ssh/juspay.pub"; + }; + }; + }; +} +