nix-config/home-manager/_mixins/cli/ssh.nix

28 lines
677 B
Nix
Raw Permalink Normal View History

2024-05-03 01:36:17 +00:00
{ outputs, lib, username, ... }:
let
hostnames = builtins.attrNames outputs.nixosConfigurations;
in
{
programs.ssh = {
enable = true;
matchBlocks = {
net = {
host = builtins.concatStringsSep " " hostnames;
forwardAgent = true;
remoteForwards = [{
bind.address = ''/%d/.gnupg-sockets/S.gpg-agent'';
host.address = ''/%d/.gnupg-sockets/S.gpg-agent.extra'';
}];
};
trusted = lib.hm.dag.entryBefore [ "net" ] {
2023-09-19 17:05:08 +00:00
host = "burd.me *.burd.me *.ts.burd.me";
forwardAgent = true;
};
};
};
home.persistence = {
2024-05-03 01:36:17 +00:00
"/persist/home/${username}".directories = [ ".ssh" ];
};
}