mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
40 lines
811 B
Nix
40 lines
811 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
gpgNoTTY = pkgs.writeShellScriptBin "gpg-no-tty" ''
|
|
exec ${pkgs.gnupg}/bin/gpg --batch --no-tty "$@"
|
|
'';
|
|
pinentrySwitcher = pkgs.callPackage ../packages/pinentry.nix { };
|
|
in
|
|
{
|
|
config = {
|
|
|
|
programs.gnupg = {
|
|
agent.enable = true;
|
|
dirmngr.enable = true;
|
|
|
|
agent.pinentryPackage = pkgs.pinentry-all;
|
|
agent.enableSSHSupport = true;
|
|
agent.enableExtraSocket = true;
|
|
agent.enableBrowserSocket = true;
|
|
};
|
|
|
|
environment.interactiveShellInit = mkAfter ''
|
|
${config.programs.gnupg.package}/bin/gpg-connect-agent --quiet updatestartuptty /bye >/dev/null
|
|
'';
|
|
|
|
environment.shellInit = ''
|
|
alias gpg=${gpgNoTTY}/bin/gpg-no-tty
|
|
'';
|
|
|
|
environment.systemPackages = [
|
|
gpgNoTTY
|
|
];
|
|
|
|
};
|
|
}
|