reddit / emacs

Emacs support for multiple pass contexts

AsterOps · 2022-04-05 03:44
Hi, according tu [arch wiki](https://wiki.archlinux.org/title/Pass#Multiple_pass_contexts_(e.g._teaming)) I've setup multiple pass contexts using aliases and env variables. From terminal works well but I am not sure is it possible to implement it in emacs. I am awere of [password-store.el](https://github.com/zx2c4/password-store/tree/c4d8a1d815e79ddd89a85d3e36a41d29f0475771/contrib/emacs) and [pass](https://github.com/NicolasPetton/pass/tree/5651da53137db9adcb125b4897c2fe27eeb4368d) packages but how to pass those non startard values to emacs? I am not elist hacker, but I checked there are `password-store-executable`, `auth-source-pass-filename` variables where I can overwrite some default values but can I define more than one value (or regex) for each? Pls help
ieure · 2022-04-05 05:02
Contexts aren't an official pass feature, the Arch wiki documents a hack to set up completely different pass repos. An alternate approach would be to have a personal pass repo, and set up a git submodule for the other one(s) you want to share. That would put the remote stuff into a subdirectory of your existing repo, and wouldn't require hacking up the Lisp. if you want do do it in elisp, though, the `password-store-dir` function is what tells it where to look. You could advise it to return a different path, or to manipulate `PASSWORD_STORE_DIR` in some way.
linuxavarice · 2022-04-05 12:23
You can use (setenv "PASSWORD_STORE_DIR" ...) for this. So just setenv before calling the main pass function should work I believe.