From 00afa4496a1dc0bdb1a2fa27dd3eb9bef4bfdbdc Mon Sep 17 00:00:00 2001 From: Soispha Date: Wed, 17 May 2023 21:38:28 +0200 Subject: Fix(hm/conf/gpg): Use nixos to write the agent script --- home-manager/config/gpg/agent-program | 2 ++ home-manager/config/gpg/default.nix | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 home-manager/config/gpg/agent-program (limited to 'home-manager/config') diff --git a/home-manager/config/gpg/agent-program b/home-manager/config/gpg/agent-program new file mode 100755 index 00000000..8817a1a2 --- /dev/null +++ b/home-manager/config/gpg/agent-program @@ -0,0 +1,2 @@ +#!/bin/sh +onlykey-gpg-agent -vv --skey-slot=ECC32 --dkey-slot=ECC32 "$@" diff --git a/home-manager/config/gpg/default.nix b/home-manager/config/gpg/default.nix index ae5a36ad..748bd0d7 100644 --- a/home-manager/config/gpg/default.nix +++ b/home-manager/config/gpg/default.nix @@ -1,8 +1,18 @@ { config, + sysLib, pkgs, ... -}: { +}: let + agent-program = sysLib.makeShellScriptWithLibrary { + name = "onlykey-gpg-agent"; + script = ./agent-program; + dependencies = with pkgs; [ + python3 + onlykey-agent + ]; + }; +in { programs.gpg = { enable = true; homedir = "${config.xdg.dataHome}/gnupg/onlykey"; @@ -10,7 +20,8 @@ mutableTrust = false; settings = { # Hardware-based GPG configuration - agent-program = "/home/soispha/.local/share/gnupg/onlykey/run-agent.sh"; + agent-program = "${agent-program}/bin/onlykey-gpg-agent"; + default-key = "Soispha "; # TODO add more }; -- cgit 1.4.1