mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-19 14:53:00 +00:00
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
51 lines
1.3 KiB
Nix
51 lines
1.3 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.programs.rofi.pass;
|
|
|
|
in {
|
|
meta.maintainers = with maintainers; [ seylerius robwalt ];
|
|
|
|
options.programs.rofi.pass = {
|
|
enable = mkEnableOption "rofi integration with password-store";
|
|
|
|
package = mkPackageOption pkgs "rofi-pass" {
|
|
nullable = true;
|
|
example = "pkgs.rofi-pass-wayland";
|
|
};
|
|
|
|
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
|
|
<https://github.com/carnager/rofi-pass/blob/master/config.example>.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
|
|
xdg.configFile."rofi-pass/config".text = optionalString (cfg.stores != [ ])
|
|
("root=" + (concatStringsSep ":" cfg.stores) + "\n") + cfg.extraConfig
|
|
+ optionalString (cfg.extraConfig != "") "\n";
|
|
};
|
|
}
|