mirror of https://github.com/wlcx/home.git
fix
This commit is contained in:
parent
665403ee0f
commit
700b56d41a
|
@ -2,11 +2,7 @@
|
|||
{pkgs, config, lib, ...}: {
|
||||
home.packages = [ pkgs.ssh-tpm-agent ];
|
||||
home.sessionVariables = {
|
||||
SSH_AUTH_SOCK = let
|
||||
maybeProxy = lib.strings.optionalString config.services.gpg-agent.enableSshSupport "-A $(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket)";
|
||||
cmd = "${pkgs.ssh-tpm-agent} --print-socket${maybeProxy}";
|
||||
in "$(${cmd})";
|
||||
TESTIFICLES = "hello";
|
||||
SSH_AUTH_SOCK = "$(${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent --print-socket)";
|
||||
};
|
||||
systemd.user.sockets.ssh-tpm-agent = {
|
||||
Unit.WantedBy = [ "sockets.target" ];
|
||||
|
@ -26,7 +22,11 @@
|
|||
Environment = ''
|
||||
SSH_AUTH_SOCK="%t/ssh-tpm-agent.sock"
|
||||
'';
|
||||
ExecStart = "${pkgs.ssh-tpm-agent}";
|
||||
ExecStart = "${pkgs.writeShellScriptBin "start-ssh-tpm-agent" (if config.services.gpg-agent.enableSshSupport then ''
|
||||
${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent -A $(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket)
|
||||
'' else ''
|
||||
${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent
|
||||
'')}/bin/start-ssh-tpm-agent";
|
||||
PassEnvironment = "SSH_AGENT_PID";
|
||||
SuccessExitStatus = 2;
|
||||
Type = "simple";
|
||||
|
|
Loading…
Reference in New Issue