system/home/progs/pass.nix

35 lines
711 B
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.pass;
passDataDir = "${config.xdg.dataHome}/pass";
myPassPackage = pkgs.pass-minimal.withExtensions (ext: [
ext.pass-audit
]);
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 = myPassPackage;
settings = {
PASSWORD_STORE_DIR = "${passDataDir}/store";
};
};
services.pass-secret-service.enable = true;
programs.gpg.enable = true;
services.gpg-agent.enable = true;
};
}