depot/third_party/home-manager/modules/programs/rofi-pass.nix
Default email a0869759be Project import generated by Copybara.
GitOrigin-RevId: ac319fd3149b23a3ad8ee24cb2def6e67acf194c
2021-07-03 00:36:30 +02:00

46 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.rofi.pass;
in {
meta.maintainers = [ maintainers.seylerius ];
options.programs.rofi.pass = {
enable = mkEnableOption "rofi integration with password-store";
stores = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Directory roots of your password-stores.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
example = ''
URL_field='url'
USERNAME_field='user'
AUTOTYPE_field='autotype'
'';
description = ''
Extra configuration to be added at to the rofi-pass config file.
Additional examples can be found at
<link xlink:href="https://github.com/carnager/rofi-pass/blob/master/config.example"/>.
'';
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.rofi-pass ];
xdg.configFile."rofi-pass/config".text = optionalString (cfg.stores != [ ])
("root=" + (concatStringsSep ":" cfg.stores) + "\n") + cfg.extraConfig
+ optionalString (cfg.extraConfig != "") "\n";
};
}