33 lines
764 B
Nix
33 lines
764 B
Nix
{ pkgs ? import <nixpkgs> { } }:
|
|
pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
|
gnupg
|
|
git
|
|
vim
|
|
pinentry-curses
|
|
];
|
|
|
|
shellHook = ''
|
|
# Set the pinentry program in gpg-agent.conf
|
|
echo "pinentry-program = ${pkgs.pinentry-curses}/bin/pinentry-curses" > $HOME/.gnupg/gpg-agent.conf
|
|
|
|
# Set the SSH agent socket for gpg-agent
|
|
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
|
|
|
|
# Reload the gpg-agent to apply changes
|
|
gpg-connect-agent reloadagent /bye
|
|
|
|
# Import public key
|
|
|
|
curl $(gpg --card-status | grep URL | cut -d' ' -f6) | gpg --import
|
|
touch dummy
|
|
gpg -r hans --encrypt dummy
|
|
gpg --decrypt dummy.gpg
|
|
|
|
|
|
# Clone the repository
|
|
git clone ssh://git@git.cluster.gay:2222/hans/nix.git
|
|
'';
|
|
}
|