parent
66a68b4a58
commit
1a7f190cb9
@ -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"; |
||||
}; |
||||
} |
@ -0,0 +1,4 @@ |
||||
{ |
||||
rofi-pass-root = ./rofi-pass-root.nix; |
||||
rofi-pass-config = ./rofi-pass-config.nix; |
||||
} |
@ -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 |
||||
|
||||
'' |
||||
} |
||||
''; |
||||
}; |
||||
} |
@ -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 new issue