2022-04-27 01:17:51 +03:00
|
|
|
{ lib, config, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.progs.pass;
|
|
|
|
pass_data_dir = "${config.home.sessionVariables.XDG_DATA_HOME}/pass";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.progs.pass = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Add and configure pass tool to manager your passwords";
|
|
|
|
};
|
|
|
|
};
|
2022-08-29 15:40:41 +03:00
|
|
|
|
2022-04-27 01:17:51 +03:00
|
|
|
config = mkIf cfg.enable {
|
2022-08-29 15:40:41 +03:00
|
|
|
home.packages = [ pkgs.pass ];
|
2022-04-27 01:17:51 +03:00
|
|
|
|
|
|
|
home.sessionVariables = {
|
|
|
|
PASSWORD_STORE_DIR = "${pass_data_dir}/store";
|
|
|
|
PASSWORD_STORE_EXTENSIONS_DIR = "${pass_data_dir}/extensions";
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.gpg.enable = true;
|
|
|
|
|
|
|
|
services.gpg-agent.enable = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|