fork/home-manager
git clone https://git.julia.blue/fork/home-manager
7ee73f53
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . programs . rofi . pass ; 8 9in { 10meta . maintainers = with maintainers ; [ seylerius robwalt ]; 11 12options . programs . rofi . pass = { 13enable = mkEnableOption "rofi integration with password-store" ; 14 15package = 16mkPackageOption pkgs "rofi-pass" { example = "pkgs.rofi-pass-wayland" ; }; 17 18stores = mkOption { 19type = types . listOf types . str ; 20default = [ ]; 21description = '' 22Directory roots of your password-stores. 23'' ; 24}; 25 26extraConfig = mkOption { 27type = types . lines ; 28default = "" ; 29example = '' 30URL_field='url' 31USERNAME_field='user' 32AUTOTYPE_field='autotype' 33'' ; 34description = '' 35Extra configuration to be added at to the rofi-pass config file. 36Additional examples can be found at 37<https://github.com/carnager/rofi-pass/blob/master/config.example>. 38'' ; 39}; 40}; 41 42config = mkIf cfg . enable { 43home . packages = [ cfg . package ]; 44 45xdg . configFile . "rofi-pass/config" . text = optionalString ( cfg . stores != [ ]) 46( "root=" + ( concatStringsSep ":" cfg . stores ) + "\n" ) + cfg . extraConfig 47+ optionalString ( cfg . extraConfig != "" ) "\n" ; 48}; 49}