mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-18 00:12:47 +01:00
password-store: add modules
This commit is contained in:
parent
ef11164c0c
commit
9d09738e4d
4 changed files with 164 additions and 0 deletions
64
modules/programs/password-store.nix
Normal file
64
modules/programs/password-store.nix
Normal file
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue