-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
age-plugin-yubikey
support
#41
Comments
I'm running into trouble here as well. Ive been trying this config: {
homeage = {
# Wrap rage so that it can discover age-plugin-yubikey
pkg = pkgs.writeShellApplication {
name = "rage";
runtimeInputs = [ pkgs.age-plugin-yubikey ];
text = ''
${pkgs.rage}/bin/rage "$@"
'';
};
identityPaths = [ "${../../secrets/keychain-yubikey-identity.txt}" ];
installationType = "activation";
# ... other config
};
} The
|
FWIW I moved my secret management to Sops-Nix which doesn't have problems with the YubiKey, I can keep using OpenPGP, and it recently got support for HM as well. I'll leave the issue open, but it's unlikely I'll be able to offer more input. |
@nekowinston did you get it working on macOS? Looking at the docs it only mentions user-level systemd rather than an activation script. |
@andrewhamon yes, it uses a |
Sadly sops doesn't seem to work with I tried some debugging by logging the args passed to rage in my wrapper script, but that didn't yield anything significant. The next step the I can think of would be to use a modified age/age with detailed debugging logs there. That feels like a fair bit more effort than simply writing my own activation script and invoking that manually, though, so I'll probably do that. |
Using the system-wide ragenix instead of the user-scoped homeage works for me with age-plugin-yubikey: { pkgs, ragenix, ... }:
let
ageWithYubikeyPlugin = pkgs.runCommand "age-wrapper" { buildInputs = [ pkgs.makeWrapper ]; } ''
mkdir -p $out/bin
makeWrapper ${pkgs.rage}/bin/rage $out/bin/rage \
--set PATH ${pkgs.age-plugin-yubikey}/bin \
--set PINENTRY_PROGRAM ${pkgs.pinentry-curses}/bin/pinentry-curses
'';
in
{
environment.systemPackages = [
pkgs.rage
pkgs.age-plugin-yubikey
ragenix.packages.x86_64-linux.default
];
age.secrets.test-secret.file = "/etc/nixos/secret1.age";
age.identityPaths = [ "/etc/nixos/identities/age-yubikey-identity-d4162ec5.txt" ];
age.ageBin = "${ageWithYubikeyPlugin}/bin/rage";
} |
Hi there!
Thanks for this project, I'm trying to add support for the rage YubiKey plugin.
What I've tried so far:
home.nix
configuration:Create the secret data & create
~/yubikey.txt
:Changes to homeage itself:
I added in
pinentry-gtk2
after finding str4d/rage#280 and assuming thathome.activation
is unable to open pinentry-curses.I'm logging the identity file content, identities provided, and yubikeys connected really only as sanity checks, which produces an output like this:
On an unrelated note, on macOS I'm getting an error mounting the secret tmpfs:Edit: just learned about
homeage.mount
, my bad.The text was updated successfully, but these errors were encountered: