2020-03-28 22:48:43 -07:00
|
|
|
{ config, options, pkgs, lib, ... }:
|
2020-10-01 15:46:04 -07:00
|
|
|
|
2020-03-28 22:48:43 -07:00
|
|
|
with lib;
|
2020-10-01 15:46:04 -07:00
|
|
|
with lib.my;
|
|
|
|
let cfg = config.modules.shell.pass;
|
|
|
|
in {
|
2020-12-21 19:35:13 -08:00
|
|
|
options.modules.shell.pass = with types; {
|
2020-10-01 15:46:04 -07:00
|
|
|
enable = mkBoolOpt false;
|
2020-12-21 19:35:13 -08:00
|
|
|
passwordStoreDir = mkOpt str "$HOME/.secrets/password-store";
|
2020-03-28 22:48:43 -07:00
|
|
|
};
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
user.packages = with pkgs; [
|
|
|
|
(pass.withExtensions (exts: [
|
|
|
|
exts.pass-otp
|
|
|
|
exts.pass-genphrase
|
|
|
|
] ++ (if config.modules.shell.gnupg.enable
|
|
|
|
then [ exts.pass-tomb ]
|
|
|
|
else [])))
|
|
|
|
];
|
2020-12-21 19:35:13 -08:00
|
|
|
env.PASSWORD_STORE_DIR = cfg.passwordStoreDir;
|
2019-08-06 10:56:54 -07:00
|
|
|
};
|
|
|
|
}
|