mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 05:03:09 +00:00
9f9e277b60
These (and the `*MD` functions apart from `literalMD`) are now no-ops in nixpkgs and serve no purpose other than to add additional noise and potentially mislead people into thinking unmarked DocBook documentation will still be accepted. Note that if backporting changes including documentation to 23.05, the `mdDoc` calls will need to be re-added. To reproduce this commit, run: $ NIX_PATH=nixpkgs=flake:nixpkgs/e7e69199f0372364a6106a1e735f68604f4c5a25 \ nix shell nixpkgs#coreutils \ -c find . -name '*.nix' \ -exec nix run -- github:emilazy/nix-doc-munge/98dadf1f77351c2ba5dcb709a2a171d655f15099 \ --strip {} + $ ./format
65 lines
1.7 KiB
Nix
65 lines
1.7 KiB
Nix
{ 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 = literalExpression "pkgs.pass";
|
|
example = literalExpression ''
|
|
pkgs.pass.withExtensions (exts: [ exts.pass-otp ])
|
|
'';
|
|
description = ''
|
|
The `pass` 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 = literalExpression ''
|
|
{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }
|
|
'';
|
|
example = literalExpression ''
|
|
{
|
|
PASSWORD_STORE_DIR = "/some/directory";
|
|
PASSWORD_STORE_KEY = "12345678";
|
|
PASSWORD_STORE_CLIP_TIME = "60";
|
|
}
|
|
'';
|
|
description = ''
|
|
The `pass` environment variables dictionary.
|
|
|
|
See the "Environment variables" section of
|
|
{manpage}`pass(1)`
|
|
and the extension man pages for more information about the
|
|
available keys.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [ cfg.package ];
|
|
home.sessionVariables = cfg.settings;
|
|
|
|
services.pass-secret-service.storePath =
|
|
mkDefault cfg.settings.PASSWORD_STORE_DIR;
|
|
|
|
xsession.importedVariables = mkIf config.xsession.enable
|
|
(mapAttrsToList (name: value: name) cfg.settings);
|
|
};
|
|
}
|