rofi & gpg

This commit is contained in:
2024-03-04 21:13:15 +01:00
parent 6f5f0fa1f5
commit 9bbebf48a2
7 changed files with 78 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
{ pkgs, ... }:
{
imports = [ ./ssh-agent.nix ];
imports = [ ./ssh-agent.nix ./gpg-agent.nix ];
}

View File

@@ -0,0 +1,28 @@
{ pkgs, ... }:
# See https://github.com/nix-community/home-manager/issues/3095
let
pinentryRofi = pkgs.writeShellApplication {
name = "pinentry-rofi-with-env";
text = ''
PATH="$PATH:${pkgs.coreutils}/bin:${pkgs.rofi}/bin"
"${pkgs.pinentry-rofi}/bin/pinentry-rofi" "$@"
'';
};
in {
home.packages = with pkgs; [ pinentry-rofi ];
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
enableZshIntegration = true;
pinentryFlavor = null;
defaultCacheTtl = 7200; # 2h
maxCacheTtl = 28800; # 8h
extraConfig = ''
pinentry-program ${pinentryRofi}/bin/pinentry-rofi-with-env
'';
};
}