Rework pass
- Remove pw script - Add otp extension
This commit is contained in:
parent
7f02d2b668
commit
368f648adc
1 changed files with 15 additions and 32 deletions
|
|
@ -1,35 +1,18 @@
|
|||
{ nixosConfig, pkgs, ... }:
|
||||
{ nixosConfig, lib, config, pkgs, ... }:
|
||||
|
||||
let
|
||||
pw = pkgs.writeScriptBin "pw" ''
|
||||
p="$(${pkgs.pass}/bin/pass show "$1")"
|
||||
|
||||
copy_line() {
|
||||
echo -n "$p" \
|
||||
| ${pkgs.gnused}/bin/sed -n "$1"p \
|
||||
| ${pkgs.wl-clipboard}/bin/wl-copy \
|
||||
--paste-once \
|
||||
--foreground \
|
||||
--trim-newline \
|
||||
--type text/plain
|
||||
}
|
||||
|
||||
echo "username"
|
||||
copy_line 2
|
||||
echo "password"
|
||||
copy_line 1
|
||||
'';
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
pw
|
||||
] ++
|
||||
(
|
||||
if nixosConfig.jalr.gui.enable
|
||||
then with pkgs; [
|
||||
qtpass
|
||||
pass-wayland
|
||||
]
|
||||
else [ ]
|
||||
);
|
||||
programs.password-store = {
|
||||
enable = true;
|
||||
package =
|
||||
if nixosConfig.jalr.gui.enable
|
||||
then pkgs.pass-wayland.withExtensions (exts: [ exts.pass-otp ])
|
||||
else pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
|
||||
};
|
||||
home.packages = lib.optionals nixosConfig.jalr.gui.enable [
|
||||
pkgs.qtpass
|
||||
];
|
||||
xdg.dataFile.password-store = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.password-store";
|
||||
target = "password-store";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue