From 91fb4f28ef5d87e8bcf7749928d30ba4a9cbbd34 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 19 Feb 2023 17:50:35 +0300 Subject: 2023-02-19 --- modules/common/password-store.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 modules/common/password-store.nix (limited to 'modules/common/password-store.nix') diff --git a/modules/common/password-store.nix b/modules/common/password-store.nix new file mode 100644 index 0000000..1de8a55 --- /dev/null +++ b/modules/common/password-store.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.nixfiles.modules.password-store; +in { + options.nixfiles.modules.password-store.enable = + mkEnableOption "the standard UNIX password manager"; + + config = mkIf cfg.enable { + hm.programs = { + password-store = { + enable = true; + + package = pkgs.pass.withExtensions (p: with p; [pass-otp]); + + settings.PASSWORD_STORE_DIR = "${config.my.home}/.password-store"; + }; + + # https://github.com/NixOS/nixpkgs/issues/183604 + bash.initExtra = let + completions = "${config.hm.programs.password-store.package}/share/bash-completion/completions"; + in + mkAfter '' + source ${completions}/pass-otp + source ${completions}/pass + ''; + }; + }; +} -- cgit 1.4.1