From be5e837dfc548badc57e648a6c0ba49e96b09ed8 Mon Sep 17 00:00:00 2001 From: jidhub Date: Sun, 19 May 2024 18:14:51 +0200 Subject: [PATCH] Adding tested installation for NixOS linux (#73) * fixing "Error: otp is not in the password store." On nixos, following https://github.com/tadfisher/pass-otp#nixnixos and https://github.com/passff/passff/issues/419 installs a version of passff-host without any extensions. The exact suggested configuration is: environment.systemPackages = with pkgs; [ ... (pass.withExtensions (ext: with ext; [pass-otp])) (firefox.override { extraNativeMessagingHosts = [ passff-host ]; }) ...]; "..." is to be replaced by the list of all other packages installed by root on your NixOS. This exact configuration does not add any extensions to passff-host, and passff keeps showing messages like [Error: otp is not in the password store.](https://github.com/tadfisher/pass-otp/issues/135). This commit documents the working nixos configuration that fixes this issue. * Update README.md adding documentations * suppressed spurious "dq" * NixOS linux installation without install_host_app.sh * expliciting the first version does not install extensions --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index d7493c3..30f8aea 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,18 @@ install_host_app.bat firefox Note: Older Windows versions might require powershell to be installed manually as the install script uses powershell internally. Windows 10 users should be fine out of the box. +#### NixOS linux + +Install the version without extensions to pass with: + + environment.systemPackages = with pkgs; [ + ... + (firefox.override { extraNativeMessagingHosts = [passff-host]; }) + ...]; + +The string "..." is to be replaced by the list of all other packages installed by root on your NixOS. The way to add extenstions to pass is [below](https://github.com/jidhub/passff-host#preferences). + + #### Latest from GitHub This is not recommended! Only for developers and for testing purposes! @@ -191,3 +203,15 @@ By modifying the *preferences section* in `passff.py`, you will be able to set: - `COMMAND_ARGS`: additional command line arguments that are passed to `pass`, - `COMMAND_ENV`: additional environment variables, - `CHARSET`: the shell stdout charset. + +If you are using [NixOS linux](https://github.com/tadfisher/pass-otp#nixnixos), you can install extensions like pass-otp in passff-host with: + + environment.systemPackages = with pkgs; [ + ... + (pass.withExtensions (ext: with ext; [pass-otp])) + (firefox.override { extraNativeMessagingHosts = [(passff-host.overrideAttrs (old: { dontStrip = true; patchPhase = '' + sed -i 's#COMMAND = "pass"#COMMAND = "${pass.withExtensions (ext: with ext; [pass-otp])}/bin/pass"#' src/passff.py + ''; }))]; }) + ...]; + +The string "..." is to be replaced by the list of all other packages installed by root on your NixOS.