global: drop yubikey-agent in favor of ssh's id-ed25519-sk

Changed files
+13 -76
creds
ssh
users
global
modules
+1 -1
creds/ssh/auth
···
-
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJxpXpPlPEZPfnw2mIuWJEy/C/5h1bb6pIMeFsHAICQ+lLdEkbBSeDXQuA8feLN0MJw8KaB9jqrJbYgFadV/nVA= YubiKey #19302295 PIV Slot 9a
+
sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAILJ3mxaweLrFL//bYIJvE1XVmjQf2Dq/CjKIPkIVmDpXAAAABHNzaDo= YubiKey #19302295
+3 -5
creds/ssh/users/cassie
···
# If I had an option, I would not use ecdsa keys.
# SmartCards
-
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGvCpt7yWIptJ9XFBhwVIj9zR30OzkWI976B/P5+0whD YubiKey #13901056 OpenPGP
+
# ssh-keygen -t ed25519-sk -C "YubiKey #${invalid:?gock}" -O{resident,verify-required}
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJxpXpPlPEZPfnw2mIuWJEy/C/5h1bb6pIMeFsHAICQ+lLdEkbBSeDXQuA8feLN0MJw8KaB9jqrJbYgFadV/nVA= YubiKey #19302295 PIV Slot 9a
-
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICMjRM3BNkLbU57RyfUx7kOlZeBEj/NByr1PfXri82aP YubiKey #19302432 OpenPGP
-
-
# Static devices
-
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIPTbZL0dq0ynBl8fy9yZmrKVWd/fOybZoqBKchP0MPM sophie@marisa.d.soopy.moe
+
sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEP1oum6r6bTb4My/ZRqhVWxYKYGEqDyijUqqL1ZCIWjAAAABHNzaDo= YubiKey #13901056
+
sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAILJ3mxaweLrFL//bYIJvE1XVmjQf2Dq/CjKIPkIVmDpXAAAABHNzaDo= YubiKey #19302295
# Phones and Portables (portals)
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICPydYsQOmcjpsuhwi+w7TD5DRPXIe3pemUYyUbmOLMt pixel7a+graphite@portal.d.soopy.moe
-1
global/default.nix
···
inputs.nix-index-database.nixosModules.nix-index
inputs.mystia.nixosModules.arrpc
-
(inputs.self + "/modules/staging/yubikey-agent.nix")
];
}
-1
global/gui/default.nix
···
./fonts.nix
./browser.nix
-
./security.nix
./development.nix
./degeneracy.nix
-11
global/gui/security.nix
···
-
{
-
pkgs,
-
lib,
-
config,
-
...
-
}:
-
lib.mkIf config.gensokyo.traits.gui {
-
services.yubikey-agent-socket.enable = true;
-
programs.gnupg.agent.pinentryPackage = pkgs.pinentry-qt;
-
# FIXME: fix yubikey-agent being stubborn
-
}
+9 -3
global/programs/ssh.nix
···
'';
};
-
programs.ssh.extraConfig = ''
-
ConnectTimeout 5
-
''; # if things exceed 5 seconds to connect something has gone wrong. Fail fast to not wait.
+
programs.ssh = {
+
startAgent = true;
+
pubkeyAcceptedKeyTypes = ["ssh-ed25519"];
+
enableAskPassword = true;
+
+
extraConfig = ''
+
ConnectTimeout 5
+
''; # if things exceed 5 seconds to connect something has gone wrong. Fail fast to not wait.
+
};
}
-54
modules/staging/yubikey-agent.nix
···
-
# from https://github.com/NixOS/nixpkgs/blob/e9be42459999a253a9f92559b1f5b72e1b44c13d/nixos/modules/services/security/yubikey-agent.nix
-
{
-
config,
-
lib,
-
pkgs,
-
...
-
}:
-
with lib; let
-
cfg = config.services.yubikey-agent-socket;
-
in {
-
###### interface
-
-
meta.maintainers = with maintainers; [philandstuff rawkode jwoudenberg];
-
-
options = {
-
services.yubikey-agent-socket = {
-
enable = mkOption {
-
type = types.bool;
-
default = false;
-
description = ''
-
Whether to start yubikey-agent when you log in. Also sets
-
SSH_AUTH_SOCK to point at yubikey-agent.
-
-
Note that yubikey-agent will use whatever pinentry is
-
specified in programs.gnupg.agent.pinentryPackage.
-
'';
-
};
-
-
package = mkPackageOption pkgs "yubikey-agent" {};
-
};
-
};
-
-
config = mkIf cfg.enable {
-
environment.systemPackages = [cfg.package];
-
systemd.packages = [cfg.package];
-
-
# This overrides the systemd user unit shipped with the
-
# yubikey-agent package
-
systemd.user.services.yubikey-agent = mkIf (config.programs.gnupg.agent.pinentryPackage != null) {
-
path = [config.programs.gnupg.agent.pinentryPackage];
-
wantedBy = ["default.target"];
-
after = ["graphical-session.target"];
-
};
-
-
# Yubikey-agent expects pcsd to be running in order to function.
-
services.pcscd.enable = true;
-
-
environment.extraInit = ''
-
if [ -z "$SSH_AUTH_SOCK" -a -n "$XDG_RUNTIME_DIR" ]; then
-
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/yubikey-agent/yubikey-agent.sock"
-
fi
-
'';
-
};
-
}