2022-04-27 01:17:51 +03:00
|
|
|
{ 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
|
|
|
|
]);
|
2022-04-27 01:17:51 +03:00
|
|
|
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-04-27 01:17:51 +03:00
|
|
|
};
|
|
|
|
};
|
2022-08-29 15:40:41 +03:00
|
|
|
|
2022-04-27 01:17:51 +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-04-27 01:17:51 +03:00
|
|
|
};
|
2022-09-01 13:29:50 +03:00
|
|
|
services.pass-secret-service.enable = true;
|
2022-04-27 01:17:51 +03:00
|
|
|
|
|
|
|
programs.gpg.enable = true;
|
|
|
|
services.gpg-agent.enable = true;
|
|
|
|
};
|
|
|
|
}
|