Merge pull request 'bitwarden' (#43) from develop into release-25.11
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 19s

Reviewed-on: #43
This commit is contained in:
sid 2026-05-18 16:39:54 +02:00
commit 5e963c26ec
5 changed files with 66 additions and 5 deletions

View file

@ -0,0 +1,46 @@
{
inputs,
config,
lib,
pkgs,
...
}:
let
cfg = config.wayland.windowManager.hyprland;
app = cfg.applications.password-manager.default;
inherit (lib) mkDefault mkIf;
in
{
imports = [ ../../../rofi-rbw ];
config = mkIf (cfg.enable && app == "rofi-rbw") {
programs.rbw = {
enable = true;
settings = {
# email = "you@example.tld"; # You have to set this in your config
pinentry = mkDefault pkgs.pinentry-gnome3;
lock_timeout = mkDefault 3600;
};
};
programs.rofi-rbw = {
enable = true;
package = mkDefault pkgs.rofi-rbw-wayland;
settings = {
selector = mkDefault "bemenu";
selector-args = mkDefault "-i -l 20";
action = mkDefault "copy";
typing-key-delay = mkDefault 0;
};
};
programs.librewolf = mkIf config.programs.librewolf.enable {
profiles.default.extensions.packages =
with inputs.nur.legacyPackages."${pkgs.stdenv.hostPlatform.system}".repos.rycee.firefox-addons; [
bitwarden
];
};
};
}

View file

@ -56,6 +56,7 @@ let
in in
{ {
imports = [ imports = [
./bitwarden
./bemenu ./bemenu
./dmenu-bluetooth ./dmenu-bluetooth
./dunst-toggle ./dunst-toggle

View file

@ -42,6 +42,14 @@ def process_csv(input_file, output_file):
for col, default_val in default_values.items(): for col, default_val in default_values.items():
if col not in new_row: if col not in new_row:
new_row[col] = default_val new_row[col] = default_val
folder = new_row.get('folder', '')
name = new_row.get('name', '')
if folder.startswith('www') and name:
if not name.startswith('http://') and not name.startswith('https://'):
new_row['login_uri'] = f'https://{name}'
else:
new_row['login_uri'] = name
if new_row['notes']: if new_row['notes']:
new_row['notes'] = new_row['notes'].replace('\n', ' ').replace('\r', ' ') new_row['notes'] = new_row['notes'].replace('\n', ' ').replace('\r', ' ')
@ -49,7 +57,6 @@ def process_csv(input_file, output_file):
notes = new_row['notes'] notes = new_row['notes']
if notes: if notes:
# Look for pattern: "login: USERNAME"
match = re.search(r'login:\s*(\S+)', notes, re.IGNORECASE) match = re.search(r'login:\s*(\S+)', notes, re.IGNORECASE)
if match: if match:
username = match.group(1) username = match.group(1)

View file

@ -2,6 +2,8 @@
stdenv, stdenv,
lib, lib,
makeWrapper, makeWrapper,
pass,
pass2csv,
python3, python3,
... ...
}: }:
@ -20,13 +22,18 @@ stdenv.mkDerivation rec {
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
sed -e "s|python ./convert_csvs.py|python $out/bin/convert_csvs.py|" \ cp ${src}/pass2bw.sh $out/bin/${pname}
${src}/${pname}.sh > $out/bin/${pname}
chmod +x $out/bin/${pname} chmod +x $out/bin/${pname}
cp ${src}/convert_csvs.py $out/bin/ cp ${src}/convert_csvs.py $out/bin/
wrapProgram $out/bin/${pname} \ wrapProgram $out/bin/${pname} \
--prefix PATH : ${lib.makeBinPath [ python3 ]} --prefix PATH : ${
lib.makeBinPath [
pass
pass2csv
python3
]
}
''; '';
} }

View file

@ -4,5 +4,5 @@ if [ "$#" -ne 2 ]; then
fi fi
pass2csv "$1" /tmp/pass.csv pass2csv "$1" /tmp/pass.csv
python ./convert_csvs.py /tmp/pass.csv "$2" python3 "$(dirname "$0")/convert_csvs.py" /tmp/pass.csv "$2"
rm /tmp/pass.csv rm /tmp/pass.csv