Nixify .ssh/config using home-manager

This commit nixify's the .ssh/config using home-manager resolves #36
This commit is contained in:
Melody Renata 2024-02-13 07:47:32 -05:00
parent fe5b476eca
commit 14cdb431a9
No known key found for this signature in database
GPG key ID: 6E2223885F29DEA5
2 changed files with 41 additions and 0 deletions

View file

@ -10,6 +10,7 @@
./tmux.nix
./neovim.nix
./helix.nix
./ssh.nix
./starship.nix
./terminal.nix
./git.nix

40
home/ssh.nix Normal file
View file

@ -0,0 +1,40 @@
{ config
, pkgs
, lib
, ...
}:
with lib;
let
inherit (pkgs) stdenv;
in
{
programs.ssh = {
enable = true;
matchBlocks = {
"*".extraOptions = mkMerge [
(mkIf (!stdenv.isDarwin) {
identityAgent = "${config.home.homeDirectory}/.1password/agent.sock";
})
(mkIf (stdenv.isDarwin) {
identityAgent = "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock";
})
];
actual = {
hostname = "167.205.125.179";
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 = "${config.home.homeDirectory}/.ssh/juspay.pub";
};
};
};
}