fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert Walterrofi-pass: add package option7ee73f53

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