This repository has no description
913 B
39 lines
1{
2 pkgs,
3 lib,
4 self,
5 ...
6}:
7let
8 ssh-tpm-agent = self.packages.${pkgs.system}.ssh-tpm-agent;
9 pinentry-rofi = self.packages.${pkgs.system}.pinentry-rofi;
10in
11{
12 security.tpm2 = {
13 enable = true;
14 pkcs11.enable = true;
15 abrmd.enable = true;
16 };
17 environment.systemPackages = [
18 pkgs.keyutils
19 ];
20 users.users.mainUser.extraGroups = [ "tss" ];
21
22 systemd.user.services.ssh-tpm-agent = {
23 description = "SSH TPM Agent";
24 wantedBy = [ "graphical-session.target" ];
25 after = [ "graphical-session.target" ];
26 serviceConfig = {
27 ExecStart = "${ssh-tpm-agent}/bin/ssh-tpm-agent -l %t/ssh-tpm-agent.sock --no-cache";
28 Environment = [
29 "SSH_ASKPASS=${lib.getExe pinentry-rofi}"
30 "SSH_ASKPASS_REQUIRE=force"
31 ];
32 Restart = "on-failure";
33 };
34 };
35
36 environment.sessionVariables = {
37 SSH_AUTH_SOCK = "\${XDG_RUNTIME_DIR}/ssh-tpm-agent.sock";
38 };
39}