about summary refs log tree commit diff
path: root/users/fcuny/desktop/trust/pass.nix
blob: a5523181c81cd2f9f868e0cd027b9517a51b4b5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ pkgs, config, ... }:

{
  programs.password-store = {
    enable = true;
    settings = {
      PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store";
      PASSWORD_STORE_GENERATED_LENGTH = "30";
      PASSWORD_STORE_CHARACTER_SET = "a-zA-Z0-9~!@#$%^&*()-_=+[]{};:,.<>?";
      PASSWORD_STORE_KEY = config.programs.gpg.settings.default-key;
    };
  };

  programs.git = {
    signing = {
      key = config.programs.gpg.settings.default-key;
      signByDefault = true;
    };
    extraConfig = {
      credential = {
        helper = "${pkgs.gitAndTools.pass-git-helper}/bin/pass-git-helper";
        useHttpPath = true;
      };
    };
  };

  xdg.configFile."pass-git-helper/git-pass-mapping.ini" = {
    source = ./git-pass-mapping.ini;
  };

  services.password-store-sync.enable = true;

  # Ensure the password store things are in the systemd session
  systemd.user.sessionVariables = config.programs.password-store.settings;
}