From 7ca519190e5be40ccae0d8b12a17c36e5469e230 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sun, 7 Nov 2021 11:20:10 +0100 Subject: works for nix now too --- build | 2 +- nix/configuration.nix | 5 ++++- nixbuild | 2 +- scripts/pinentry-auto | 9 ++++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/build b/build index a8e38e9..c83817a 100755 --- a/build +++ b/build @@ -40,7 +40,7 @@ ln -s "$ST_DIR/st" "$HOME/bin" # pinentry-dmenu setup PE_DIR="$HOME/src/pinentry-dmenu" -git clone https://git.tombarrett.xyz/tom/st "$PE_DIR" +git clone https://git.tombarrett.xyz/tom/pinentry-dmenu "$PE_DIR" make -C "$PE_DIR" diff --git a/nix/configuration.nix b/nix/configuration.nix index aa6f3e0..2ee63d0 100644 --- a/nix/configuration.nix +++ b/nix/configuration.nix @@ -32,6 +32,7 @@ w3m firefox wget + tmux curl dmenu pass @@ -40,14 +41,16 @@ neomutt acpi ranger + ncdu mpc_cli lm_sensors + pinentry-curses ]; programs.gnupg.agent = { enable = true; - pinentryFlavor = "gtk2"; enableSSHSupport = true; + pinentryFlavor = null; }; programs.zsh.enable = true; diff --git a/nixbuild b/nixbuild index 0012392..b82e12e 100755 --- a/nixbuild +++ b/nixbuild @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -p xorg.libX11.dev xorg.libXft xorg.libXinerama git bash pkg-config +#!nix-shell -p xorg.libX11.dev xorg.libXft xorg.libXinerama git bash pkg-config gpgme libconfig #!nix-shell -i bash ./build diff --git a/scripts/pinentry-auto b/scripts/pinentry-auto index 4b90cc1..d9c7bda 100755 --- a/scripts/pinentry-auto +++ b/scripts/pinentry-auto @@ -1,7 +1,14 @@ #!/bin/sh set -Ceu -if ps -e | grep -q X; then +# for nixos +exists=$(command -v pgrep || echo "") +if [ -z "$exists" ]; then + PATH="/run/current-system/sw/bin/:"$PATH +fi + + +if pgrep -x X > /dev/null; then /home/"$USER"/bin/pinentry-dmenu "$@" else pinentry-curses "$@" -- cgit v1.2.3