system/home/progs/pass.nix

32 lines
639 B
Nix
Raw Normal View History

{ 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
config = mkIf cfg.enable {
2022-08-29 15:40:41 +03:00
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;
};
}