31 lines
639 B
Nix
31 lines
639 B
Nix
{ 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";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [ pkgs.pass ];
|
|
|
|
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;
|
|
};
|
|
}
|
|
|