From edc7792b47f975f8b3620c890333200a5f78c70e Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Wed, 16 Feb 2022 13:31:15 +0300 Subject: [PATCH] Fix GPG_TTY --- profiles/workspace/gnome3/default.nix | 1 + profiles/workspace/gpg.nix | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/profiles/workspace/gnome3/default.nix b/profiles/workspace/gnome3/default.nix index 472121a..3d7b013 100644 --- a/profiles/workspace/gnome3/default.nix +++ b/profiles/workspace/gnome3/default.nix @@ -46,6 +46,7 @@ ExecStart = lib.mkForce "${pkgs.pass-secret-service}/bin/pass_secret_service --path ${config.environment.variables.PASSWORD_STORE_DIR}"; Type = "dbus"; + Environment = [ "GPG_TTY=/dev/tty1" "DISPLAY=:0" ]; BusName = "org.freedesktop.secrets"; }; Unit = rec { diff --git a/profiles/workspace/gpg.nix b/profiles/workspace/gpg.nix index 10fb590..ebce2b8 100644 --- a/profiles/workspace/gpg.nix +++ b/profiles/workspace/gpg.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: { +{ pkgs, lib, config, ... }: { services.pcscd.enable = true; services.udev.packages = [ pkgs.yubikey-personalization ]; @@ -11,6 +11,16 @@ pinentryFlavor = "gtk2"; }; + systemd.user.services.gpg-agent = { + Service = { + Environment = lib.mkForce [ + "GPG_TTY=/dev/tty1" + "DISPLAY=:0" + "GNUPGHOME=${config.home-manager.users.balsoft.xdg.dataHome}/gnupg" + ]; + }; + }; + programs.gpg = { enable = true; homedir = "${config.home-manager.users.balsoft.xdg.dataHome}/gnupg";