1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-05 16:41:04 +01:00
home-manager/modules/programs/rofi-pass.nix
Austin Horstman 0b491b460f
treewide: remove with lib (#6735)
Continuation of `with lib;` cleanup.
2025-03-31 22:32:16 -05:00

49 lines
1.3 KiB
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) types;
cfg = config.programs.rofi.pass;
in {
meta.maintainers = with lib.maintainers; [ seylerius robwalt ];
options.programs.rofi.pass = {
enable = lib.mkEnableOption "rofi integration with password-store";
package = lib.mkPackageOption pkgs "rofi-pass" {
nullable = true;
example = "pkgs.rofi-pass-wayland";
};
stores = lib.mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Directory roots of your password-stores.
'';
};
extraConfig = lib.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
<https://github.com/carnager/rofi-pass/blob/master/config.example>.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."rofi-pass/config".text =
lib.optionalString (cfg.stores != [ ])
("root=" + (lib.concatStringsSep ":" cfg.stores) + "\n") + cfg.extraConfig
+ lib.optionalString (cfg.extraConfig != "") "\n";
};
}