Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitwarden: init at 1.15.2 #65764

Merged
merged 1 commit into from Aug 7, 2019
Merged

bitwarden: init at 1.15.2 #65764

merged 1 commit into from Aug 7, 2019

Conversation

Kiwi
Copy link
Member

@Kiwi Kiwi commented Aug 2, 2019

Motivation for this change

Started using bitwarden and it's really nice so I thought I'd add the GUI (someone else asked for it already as well #51212 )

EDIT for posterity: this was fixed by packaging it differently (it does it when run with electron binary)

There's a weird thing that happens and I'm not sure if it's something I did or intentional on the developers part (I'm not sure I've done the expression right anyway) in that it launches the app with the devtools panel open. F12 and it goes away or close it. shrug If someone knows a better way to package electron apps I'd be glad for suggestions. Other than that it seems to work fine.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

Copy link
Member

@angristan angristan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm this builds and runs. The dev tools also open for me, this is weird... 🧐

pkgs/tools/security/bitwarden/default.nix Outdated Show resolved Hide resolved
pkgs/tools/security/bitwarden/default.nix Outdated Show resolved Hide resolved
pkgs/tools/security/bitwarden/default.nix Outdated Show resolved Hide resolved
pkgs/tools/security/bitwarden/default.nix Outdated Show resolved Hide resolved
@worldofpeace
Copy link
Contributor

eval failure is because gdk_pixbuf was renamed to gdk-pixbuf.

@worldofpeace
Copy link
Contributor

this seemed to work for me @Kiwi, let my know what happens

diff --git a/pkgs/tools/security/bitwarden/default.nix b/pkgs/tools/security/bitwarden/default.nix
index 189e68fe3fa..b34f238dffc 100644
--- a/pkgs/tools/security/bitwarden/default.nix
+++ b/pkgs/tools/security/bitwarden/default.nix
@@ -97,7 +97,7 @@ let
     unpackPhase = "dpkg-deb -x $src .";
 
     installPhase = ''
-      mkdir -p "$out"
+      mkdir -p "$out/bin"
       cp -R "opt" "$out"
       cp -R "usr/share" "$out/share"
       chmod -R g-w "$out"
@@ -105,12 +105,13 @@ let
       # Desktop file
       mkdir -p "$out/share/applications"
       cp "${desktopItem}/share/applications/"* "$out/share/applications"
-    '';
 
-    postFixup = ''
-      makeWrapper $out/opt/Bitwarden/bitwarden $out/bin/bitwarden \
-      --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc libsecret udev ] }"
+      ln -s $out/opt/Bitwarden/bitwarden $out/bin/bitwarden
     '';
+
+    runtimeDependencies = [
+      udev.lib
+    ];
   };
 
 in if stdenv.isDarwin

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

along with the above patch, can you unpack the archive and run ldd on the executables?
Anything that's not found should be a library in buildInputs. After inspection there's several here (like hunspell) that we don't need.

After that we can merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants