mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
rofi-pass: add rofi-pass plugin for password-store
This commit is contained in:
parent
66a68b4a58
commit
1a7f190cb9
9 changed files with 137 additions and 0 deletions
3
.github/CODEOWNERS
vendored
3
.github/CODEOWNERS
vendored
|
@ -119,6 +119,9 @@
|
|||
|
||||
/modules/programs/powerline-go.nix @DamienCassou
|
||||
|
||||
/modules/programs/rofi-pass.nix @seylerius
|
||||
/tests/modules/programs/rofi-pass @seylerius
|
||||
|
||||
/modules/programs/rtorrent.nix @marsam
|
||||
|
||||
/modules/programs/ssh.nix @rycee
|
||||
|
|
|
@ -37,4 +37,14 @@
|
|||
github = "matrss";
|
||||
githubId = 9308656;
|
||||
};
|
||||
seylerius = {
|
||||
email = "sable@seyleri.us";
|
||||
name = "Sable Seyler";
|
||||
github = "seylerius";
|
||||
githubId = 1145981;
|
||||
keys = [{
|
||||
logkeyid = "rsa4096/0x68BF2EAE6D91CAFF";
|
||||
fingerprint = "F0E0 0311 126A CD72 4392 25E6 68BF 2EAE 6D91 CAFF";
|
||||
}];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1775,6 +1775,13 @@ in
|
|||
A new module is available: 'services.pbgopy'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-12-18T22:22:25+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.rofi.pass'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@ let
|
|||
(loadModule ./programs/qutebrowser.nix { })
|
||||
(loadModule ./programs/readline.nix { })
|
||||
(loadModule ./programs/rofi.nix { })
|
||||
(loadModule ./programs/rofi-pass.nix { })
|
||||
(loadModule ./programs/rtorrent.nix { })
|
||||
(loadModule ./programs/skim.nix { })
|
||||
(loadModule ./programs/starship.nix { })
|
||||
|
|
46
modules/programs/rofi-pass.nix
Normal file
46
modules/programs/rofi-pass.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{ 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";
|
||||
};
|
||||
}
|
|
@ -89,6 +89,7 @@ import nmt {
|
|||
./modules/programs/ncmpcpp-linux
|
||||
./modules/programs/neovim # Broken package dependency on Darwin.
|
||||
./modules/programs/rofi
|
||||
./modules/programs/rofi-pass
|
||||
./modules/programs/waybar
|
||||
./modules/services/dropbox
|
||||
./modules/services/emacs
|
||||
|
|
4
tests/modules/programs/rofi-pass/default.nix
Normal file
4
tests/modules/programs/rofi-pass/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
rofi-pass-root = ./rofi-pass-root.nix;
|
||||
rofi-pass-config = ./rofi-pass-config.nix;
|
||||
}
|
35
tests/modules/programs/rofi-pass/rofi-pass-config.nix
Normal file
35
tests/modules/programs/rofi-pass/rofi-pass-config.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
|
||||
pass = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
# Extra config for rofi-pass
|
||||
xdotool_delay=12
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: { rofi-pass = pkgs.writeScriptBin "dummy-rofi-pass" ""; })
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/rofi-pass/config \
|
||||
${
|
||||
pkgs.writeText "rofi-pass-expected-config" ''
|
||||
# Extra config for rofi-pass
|
||||
xdotool_delay=12
|
||||
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
30
tests/modules/programs/rofi-pass/rofi-pass-root.nix
Normal file
30
tests/modules/programs/rofi-pass/rofi-pass-root.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
|
||||
pass = {
|
||||
enable = true;
|
||||
stores = [ "~/.local/share/password-store" ];
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(self: super: { rofi-pass = pkgs.writeScriptBin "dummy-rofi-pass" ""; })
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/rofi-pass/config \
|
||||
${
|
||||
pkgs.writeText "rofi-pass-expected-config" ''
|
||||
root=~/.local/share/password-store
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue