aboutsummaryrefslogtreecommitdiffstats
path: root/modules/programs/pass/default.nix
blob: 0455d31259fc55898a967df07242395ae504ac99 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# pass - Standard Unix password manager
{
  config,
  lib,
  pkgs,
  ...
}:

{
  options.programs.pass = {
    enable = lib.mkEnableOption "Enables pass.";

    package = lib.mkPackageOption pkgs "pass" { };

    storeDir = lib.mkOption {
      type = lib.types.str;
      default = "${config.home.homeDirectory}/.password-store";
      description = "Path to the pass password store.";
    };
  };

  config = lib.mkIf config.programs.pass.enable {
    programs.password-store = {
      enable = true;
      package = config.programs.pass.package;
      settings = {
        PASSWORD_STORE_DIR = config.programs.pass.storeDir;
      };
    };

    # home.file.".config/pass-git-helper/git-pass-mapping.ini".text = ''
    #   [github.com]
    #   target = github/token
    #   username = ${config.programs.pass.github.username}
    #   username_extractor = static
    #
    #   [github.com/*]
    #   target = github/token
    #   username = ${config.programs.pass.github.username}
    #   username_extractor = static
    #
    #   [*.github.com]
    #   target = github/token
    #   username = ${config.programs.pass.github.username}
    #   username_extractor = static
    #
    #   [*.github.com/*]
    #   target = github/token
    #   username = ${config.programs.pass.github.username}
    #   username_extractor = static
    # '';
  };
}