mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 17:57:50 +00:00
34 lines
810 B
Nix
34 lines
810 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
|
|
];
|
|
|
|
};
|
|
}
|