diff options
Diffstat (limited to 'users/seth/mixins/ssh.nix')
| -rw-r--r-- | users/seth/mixins/ssh.nix | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/users/seth/mixins/ssh.nix b/users/seth/mixins/ssh.nix new file mode 100644 index 0000000..3ae26b2 --- /dev/null +++ b/users/seth/mixins/ssh.nix @@ -0,0 +1,67 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + inherit (pkgs.stdenv.hostPlatform) isLinux; +in + +{ + config = lib.mkMerge [ + { + programs.ssh = { + package = pkgs.openssh; + + matchBlocks = + let + sshDir = "${config.home.homeDirectory}/.ssh"; + in + { + # git forges + "codeberg.org" = { + identityFile = "${sshDir}/codeberg"; + user = "git"; + }; + + "github.com" = { + identityFile = "${sshDir}/github"; + user = "git"; + }; + + # linux packaging + "aur.archlinux.org" = { + identityFile = "${sshDir}/aur"; + user = "aur"; + }; + + "pagure.io" = { + identityFile = "${sshDir}/copr"; + user = "git"; + }; + + # macstadium m1 + "mini.scrumplex.net" = { + identityFile = "${sshDir}/macstadium"; + user = "bob-the-builder"; + }; + + # router + "192.168.1.1" = { + identityFile = "${sshDir}/openwrt"; + user = "root"; + }; + + # servers + "atlas".user = "atlas"; + }; + }; + } + + (lib.mkIf config.programs.ssh.enable { + services.ssh-agent.enable = lib.mkDefault isLinux; + }) + ]; +} |
