about summary refs log tree commit diff
path: root/home/pass/default.nix
blob: 043ff6c44c449b5ffad68a54a75e9db4ad06556a (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
36
37
38
{ config, lib, pkgs, ... }:
let cfg = config.my.home.pass;
in
{
  options.my.home.pass = with lib; {
    enable = mkEnableOption "pass configuration";
  };
  config = lib.mkIf cfg.enable {
    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;
      };
    };

    home.sessionVariables = {
      PASSAGE_DIR = "${config.xdg.dataHome}/passage/store";
      PASSAGE_IDENTITIES_FILE = "${config.xdg.dataHome}/passage/identities";
      # for now I have to default to rage, as the version of age is
      # not recent enough to work with keys generated by
      # age-plugin-yubikey
      PASSAGE_AGE = "${pkgs.rage}/bin/rage";
    };

    home.packages = with pkgs; [
      passage
      tree
    ];

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

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