system/home/progs/pass.nix

36 lines
711 B
Nix
Raw Normal View History

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.pass;
2022-09-01 13:29:50 +03:00
passDataDir = "${config.xdg.dataHome}/pass";
2022-09-04 23:37:43 +03:00
myPassPackage = pkgs.pass-minimal.withExtensions (ext: [
ext.pass-audit
]);
in
{
options.progs.pass = {
enable = mkOption {
type = types.bool;
default = false;
2022-09-01 13:30:43 +03:00
description = "Enables pass tool to manage your passwords";
};
};
2022-08-29 15:40:41 +03:00
config = mkIf cfg.enable {
2022-09-01 13:29:50 +03:00
programs.password-store = {
enable = true;
2022-09-04 23:37:43 +03:00
package = myPassPackage;
2022-09-01 13:29:50 +03:00
settings = {
PASSWORD_STORE_DIR = "${passDataDir}/store";
};
};
2022-09-01 13:29:50 +03:00
services.pass-secret-service.enable = true;
programs.gpg.enable = true;
services.gpg-agent.enable = true;
};
}