538fb0390a
And cache the git signing key
166 lines
4.8 KiB
Nix
166 lines
4.8 KiB
Nix
{ pkgs, ... }:
|
|
{
|
|
# Enable gnome-keyring at system level for PAM integration
|
|
services.gnome.gnome-keyring.enable = true;
|
|
|
|
# Use openssh's own ssh-agent — gcr's ssh-agent stalls signing RSA keys.
|
|
services.gnome.gcr-ssh-agent.enable = false;
|
|
programs.ssh.startAgent = true;
|
|
|
|
home-manager.users.alex = {
|
|
services.gnome-keyring = {
|
|
enable = true;
|
|
components = [ "secrets" ];
|
|
};
|
|
|
|
home.sessionVariables = {
|
|
# gnome-keyring's PAM hooks export SSH_AUTH_SOCK pointing at a dead gcr
|
|
# socket (gcr-ssh-agent is disabled above), which shadows openssh's own
|
|
# agent and silently breaks passphrase caching. Force it back to the
|
|
# openssh agent started by `programs.ssh.startAgent`.
|
|
SSH_AUTH_SOCK = "$XDG_RUNTIME_DIR/ssh-agent";
|
|
|
|
# Route passphrase prompts through seahorse's GUI askpass instead of the
|
|
# terminal. `prefer` uses the GUI even when a tty is attached (ssh only
|
|
# falls back to askpass with no controlling terminal otherwise).
|
|
SSH_ASKPASS = "${pkgs.seahorse}/libexec/seahorse/ssh-askpass";
|
|
SSH_ASKPASS_REQUIRE = "prefer";
|
|
};
|
|
|
|
programs.ssh = {
|
|
enable = true;
|
|
enableDefaultConfig = false;
|
|
|
|
matchBlocks = {
|
|
"manatee" = {
|
|
hostname = "manatee";
|
|
user = "alex";
|
|
identityFile = "/home/alex/.ssh/alex.pinwheel-manatee";
|
|
port = 1122;
|
|
};
|
|
|
|
"backwards" = {
|
|
hostname = "backwards";
|
|
user = "alex";
|
|
identityFile = "/home/alex/.ssh/alex.pinwheel-backwards";
|
|
port = 1122;
|
|
};
|
|
|
|
"tadpole" = {
|
|
hostname = "65.21.106.222";
|
|
user = "alex";
|
|
identityFile = "/home/alex/.ssh/alex.pinwheel-tadpole";
|
|
port = 1122;
|
|
};
|
|
|
|
"github.com" = {
|
|
hostname = "github.com";
|
|
identityFile = "/home/alex/.ssh/alex.pinwheel-github.com";
|
|
};
|
|
|
|
"git.ppp.pm" = {
|
|
hostname = "git.ppp.pm";
|
|
identityFile = "/home/alex/.ssh/alex.pinwheel-git.ppp.pm";
|
|
};
|
|
|
|
"*" = {
|
|
forwardAgent = false;
|
|
addKeysToAgent = "yes";
|
|
compression = false;
|
|
serverAliveInterval = 0;
|
|
serverAliveCountMax = 3;
|
|
hashKnownHosts = false;
|
|
userKnownHostsFile = "~/.ssh/known_hosts";
|
|
controlMaster = "no";
|
|
controlPath = "~/.ssh/master-%r@%n:%p";
|
|
controlPersist = "no";
|
|
};
|
|
};
|
|
};
|
|
|
|
home.packages = [
|
|
pkgs.sshfs
|
|
pkgs.seahorse # GUI for managing gnome-keyring
|
|
];
|
|
};
|
|
|
|
age.secrets = {
|
|
"alex.pinwheel-manatee" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-manatee.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-manatee";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
"alex.pinwheel-manatee.pub" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-manatee.pub.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-manatee.pub";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
|
|
"alex.pinwheel-backwards" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-backwards.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-backwards";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
"alex.pinwheel-backwards.pub" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-backwards.pub.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-backwards.pub";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
|
|
"alex.pinwheel-github.com" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-github.com.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-github.com";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
"alex.pinwheel-github.com.pub" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-github.com.pub.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-github.com.pub";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
|
|
"alex.pinwheel-git.ppp.pm" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-git.ppp.pm.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-git.ppp.pm";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
"alex.pinwheel-git.ppp.pm.pub" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-git.ppp.pm.pub.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-git.ppp.pm.pub";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
|
|
"alex.pinwheel-tadpole" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-tadpole.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-tadpole";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
"alex.pinwheel-tadpole.pub" = {
|
|
file = ../../../../secrets/pinwheel/alex.pinwheel-tadpole.pub.age;
|
|
path = "/home/alex/.ssh/alex.pinwheel-tadpole.pub";
|
|
owner = "alex";
|
|
group = "users";
|
|
};
|
|
};
|
|
|
|
services.openssh = {
|
|
enable = true;
|
|
ports = [ 1122 ];
|
|
|
|
hostKeys = [
|
|
{
|
|
path = "/etc/ssh/pinwheel";
|
|
type = "ed25519";
|
|
}
|
|
];
|
|
};
|
|
}
|