diff options
author | Soispha <soispha@vhack.eu> | 2023-05-17 21:38:28 +0200 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-05-17 22:14:42 +0200 |
commit | 00afa4496a1dc0bdb1a2fa27dd3eb9bef4bfdbdc (patch) | |
tree | 5216473b89dedbfe0f8e0f78dab0d9edb833e8a6 /home-manager/config/gpg | |
parent | Feat(hm/conf/gpg): Enforce key entry through nixos config (diff) | |
download | nixos-config-00afa4496a1dc0bdb1a2fa27dd3eb9bef4bfdbdc.tar.gz nixos-config-00afa4496a1dc0bdb1a2fa27dd3eb9bef4bfdbdc.zip |
Fix(hm/conf/gpg): Use nixos to write the agent script
Diffstat (limited to 'home-manager/config/gpg')
-rwxr-xr-x | home-manager/config/gpg/agent-program | 2 | ||||
-rw-r--r-- | home-manager/config/gpg/default.nix | 15 |
2 files changed, 15 insertions, 2 deletions
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 <soispha@vhack.eu>"; # TODO add more }; |