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

_1password: 1.1.1 -> 1.2.0 #92375

Closed

Conversation

IvarWithoutBones
Copy link
Member

@IvarWithoutBones IvarWithoutBones commented Jul 5, 2020

Motivation for this change

Another new 1password release. Release notes state that bash and zsh completion is added, though you have to manually enable it as per their help section. (source <(op completion bash) for bash, eval "$(op _completion zsh)"; compdef _op op for zsh). Not sure if we can automate this.

Added myself as a maintainer as well, as i actively use this application a lot.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

@danieldk
Copy link
Contributor

danieldk commented Jul 6, 2020

Another new 1password release. Release notes state that bash and zsh completion is added, though you have to manually enable it as per their help section. (source <(op completion bash) for bash, eval "$(op _completion zsh)"; compdef _op op for zsh). Not sure if we can automate this.

In postInstall do (untested):

$out/bin/op completion bash > op.bash
$out/bin/op completion zsh > op.zsh
installShellCompletion op.{bash,zsh}

To get installShellCompletion, put installShellFiles in nativeBuildInputs.

@IvarWithoutBones
Copy link
Member Author

Another new 1password release. Release notes state that bash and zsh completion is added, though you have to manually enable it as per their help section. (source <(op completion bash) for bash, eval "$(op _completion zsh)"; compdef _op op for zsh). Not sure if we can automate this.

In postInstall do (untested):

$out/bin/op completion bash > op.bash
$out/bin/op completion zsh > op.zsh
installShellCompletion op.{bash,zsh}

To get installShellCompletion, put installShellFiles in nativeBuildInputs.

Thank you, was not aware this was a thing. Not sure how i can test this though, usually i just build my changes with nix-build, however this doesn't seem to enable the completion.

@IvarWithoutBones IvarWithoutBones force-pushed the 1password-1.2.0 branch 2 times, most recently from 8050499 to 6ff211c Compare July 6, 2020 11:12
Comment on lines 44 to 48
postInstall = ''
$out/bin/op completion bash > op.bash
$out/bin/op completion zsh > op.zsh
installShellCompletion op.{bash,zsh}
'';
Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't look at the rest of the derivation yet and it seems that it already has an installPhase, so these can just go there.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmpf, that's annoying, this is a precompiled binary, so it's not actually runnable yet. Moreover, moving this to postFixup doesn't work either, because auto-patchelf also runs during postFixup.

There are three obvious options, but I don't have any strong preferences:

  1. Do not ship the shell completions.
  2. Run autoPatchelf in another phase.
  3. Use a patchPhase that does everything in the correct order.

Anyone?

pkgs/applications/misc/1password/default.nix Outdated Show resolved Hide resolved
@marsam
Copy link
Contributor

marsam commented Oct 4, 2020

superseded by 020ff69

@marsam marsam closed this Oct 4, 2020
@IvarWithoutBones IvarWithoutBones deleted the 1password-1.2.0 branch October 5, 2020 12:51
@IvarWithoutBones IvarWithoutBones restored the 1password-1.2.0 branch October 5, 2020 12:51
@IvarWithoutBones IvarWithoutBones deleted the 1password-1.2.0 branch October 5, 2020 12:51
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

4 participants