system/home/progs/pass.nix

31 lines
630 B
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.pass;
passDataDir = "${config.xdg.dataHome}/pass";
in
{
options.progs.pass = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enables pass tool to manage your passwords";
};
};
config = mkIf cfg.enable {
programs.password-store = {
enable = true;
package = pkgs.pass-minimal;
settings = {
PASSWORD_STORE_DIR = "${passDataDir}/store";
};
};
services.pass-secret-service.enable = true;
programs.gpg.enable = true;
services.gpg-agent.enable = true;
};
}