fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . programs . password-store ; 8 9in { 10meta . maintainers = with maintainers ; [ pacien ]; 11 12options . programs . password-store = { 13enable = mkEnableOption "Password store" ; 14 15package = mkOption { 16type = types . package ; 17default = pkgs . pass ; 18defaultText = literalExpression "pkgs.pass" ; 19example = literalExpression '' 20pkgs.pass.withExtensions (exts: [ exts.pass-otp ]) 21'' ; 22description = '' 23The `pass` package to use. 24Can be used to specify extensions. 25'' ; 26}; 27 28settings = mkOption rec { 29type = with types ; attrsOf str ; 30apply = mergeAttrs default ; 31default = { 32PASSWORD_STORE_DIR = " ${ config . xdg . dataHome } /password-store" ; 33}; 34defaultText = literalExpression '' 35{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; } 36'' ; 37example = literalExpression '' 38{ 39PASSWORD_STORE_DIR = "/some/directory"; 40PASSWORD_STORE_KEY = "12345678"; 41PASSWORD_STORE_CLIP_TIME = "60"; 42} 43'' ; 44description = '' 45The `pass` environment variables dictionary. 46 47See the "Environment variables" section of 48{manpage}`pass(1)` 49and the extension man pages for more information about the 50available keys. 51'' ; 52}; 53}; 54 55config = mkIf cfg . enable { 56home . packages = [ cfg . package ]; 57home . sessionVariables = cfg . settings ; 58 59services . pass-secret-service . storePath = 60mkDefault cfg . settings . PASSWORD_STORE_DIR ; 61 62xsession . importedVariables = mkIf config . xsession . enable 63( mapAttrsToList ( name :value :name ) cfg . settings ); 64}; 65}