helm/modules/shell/pass.nix

24 lines
571 B
Nix
Raw Permalink Normal View History

2020-03-28 22:48:43 -07:00
{ config, options, pkgs, lib, ... }:
2020-03-28 22:48:43 -07:00
with lib;
with lib.my;
let cfg = config.modules.shell.pass;
in {
options.modules.shell.pass = with types; {
enable = mkBoolOpt false;
passwordStoreDir = mkOpt str "$HOME/.secrets/password-store";
2020-03-28 22:48:43 -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 [])))
];
env.PASSWORD_STORE_DIR = cfg.passwordStoreDir;
2019-08-06 10:56:54 -07:00
};
}