From 27c9899ec55e34492701d1c5a06966d83e2ed6d1 Mon Sep 17 00:00:00 2001 From: willemml Date: Sat, 11 Nov 2023 02:53:11 -0800 Subject: [PATCH] Enables home-manager config for ssh --- home/darwin/default.nix | 2 ++ home/programs/default.nix | 3 ++- home/programs/ssh.nix | 40 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 home/programs/ssh.nix diff --git a/home/darwin/default.nix b/home/darwin/default.nix index 318f9d4..3c8b85b 100644 --- a/home/darwin/default.nix +++ b/home/darwin/default.nix @@ -18,6 +18,8 @@ programs.command-not-found.enable = true; + programs.ssh.includes = ["/Users/willem/.colima/ssh_config"]; + home.file.".gnupg/gpg-agent.conf" = { text = '' pinentry-program "${pkgs.pinentry-touchid}/bin/pinentry-touchid" diff --git a/home/programs/default.nix b/home/programs/default.nix index c3071f3..fe30aab 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -5,8 +5,9 @@ ... }: { imports = [ - ./zsh.nix ./emacs + ./ssh.nix + ./zsh.nix ]; programs = { diff --git a/home/programs/ssh.nix b/home/programs/ssh.nix new file mode 100644 index 0000000..ba422cc --- /dev/null +++ b/home/programs/ssh.nix @@ -0,0 +1,40 @@ +{...}: { + programs.ssh = { + enable = true; + + forwardAgent = true; + + extraConfig = '' + IgnoreUnknown UseKeychain + AddKeysToAgent yes + UseKeychain yes + IdentityFile ~/.ssh/id_ed25519 + ''; + + matchBlocks = { + "zeus" = { + host = "10.1.2.16"; + user = "willem"; + }; + "nixbox" = { + host = "10.1.2.175"; + user = "willem"; + }; + "ubc" = { + host = "remote.students.cs.ubc.ca"; + user = "willemml"; + }; + "*.students.cs.ubc.ca" = { + user = "willemml"; + }; + "github.com" = { + host = "ssh.github.com"; + port = 443; + }; + "orlia-nas" = { + host = "192.168.1.251"; + user = "willem"; + }; + }; + }; +}