diff options
author | pacien <pacien.trangirard@pacien.net> | 2019-07-14 21:09:53 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2019-11-29 23:03:15 +0100 |
commit | 9d09738e4dd4b4a80f3a26e0e0fe14a06dd53ddc (patch) | |
tree | cbb663c9bb6ac5776c2690bd71ef3ecec57c9cfa /modules/programs/password-store.nix | |
parent | ef11164c0c930c5dbe48c34a47e3567fc2e9a352 (diff) |
password-store: add modules
Diffstat (limited to 'modules/programs/password-store.nix')
-rw-r--r-- | modules/programs/password-store.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/modules/programs/password-store.nix b/modules/programs/password-store.nix new file mode 100644 index 00000000000..a15f002c27c --- /dev/null +++ b/modules/programs/password-store.nix @@ -0,0 +1,64 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.password-store; + +in + +{ + meta.maintainers = with maintainers; [ pacien ]; + + options.programs.password-store = { + enable = mkEnableOption "Password store"; + + package = mkOption { + type = types.package; + default = pkgs.pass; + defaultText = literalExample "pkgs.pass"; + example = literalExample '' + pkgs.pass.withExtensions (exts: [ exts.pass-otp ]) + ''; + description = '' + The <literal>pass</literal> package to use. + Can be used to specify extensions. + ''; + }; + + settings = mkOption rec { + type = with types; attrsOf str; + apply = mergeAttrs default; + default = { + PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store"; + }; + defaultText = literalExample '' + { PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; } + ''; + example = literalExample '' + { + PASSWORD_STORE_DIR = "/some/directory"; + PASSWORD_STORE_KEY = "12345678"; + PASSWORD_STORE_CLIP_TIME = "60"; + } + ''; + description = '' + The <literal>pass</literal> environment variables dictionary. + </para><para> + See the "Environment variables" section of + <citerefentry> + <refentrytitle>pass</refentrytitle> + <manvolnum>1</manvolnum> + </citerefentry> + and the extension man pages for more information about the + available keys. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + home.sessionVariables = cfg.settings; + }; +} |