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, ...}: {
|
{pkgs, config, lib, ...}: {
|
||||||
home.packages = [ pkgs.ssh-tpm-agent ];
|
home.packages = [ pkgs.ssh-tpm-agent ];
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
SSH_AUTH_SOCK = let
|
SSH_AUTH_SOCK = "$(${pkgs.ssh-tpm-agent}/bin/ssh-tpm-agent --print-socket)";
|
||||||
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";
|
|
||||||
};
|
};
|
||||||
systemd.user.sockets.ssh-tpm-agent = {
|
systemd.user.sockets.ssh-tpm-agent = {
|
||||||
Unit.WantedBy = [ "sockets.target" ];
|
Unit.WantedBy = [ "sockets.target" ];
|
||||||
|
@ -26,7 +22,11 @@
|
||||||
Environment = ''
|
Environment = ''
|
||||||
SSH_AUTH_SOCK="%t/ssh-tpm-agent.sock"
|
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";
|
PassEnvironment = "SSH_AGENT_PID";
|
||||||
SuccessExitStatus = 2;
|
SuccessExitStatus = 2;
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
|
|
Loading…
Reference in New Issue