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

qutebrowser: add quickmark support #2059

Merged

Conversation

IvarWithoutBones
Copy link
Contributor

Closes: #1230

Description

This allows the qutebrowser derivation to parse quickmarks, which I've been wanting to use for a while. If unset, qutebrowser will manage the file instead of home-manager.

When quickmarks are set through home-manager, they cannot be edited at runtime.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

@IvarWithoutBones IvarWithoutBones requested a review from rycee as a code owner May 31, 2021 18:41
Comment on lines +295 to +296
quickmarksFile = optionals (cfg.quickmarks != { }) concatStringsSep "\n"
((mapAttrsToList formatQuickmarks cfg.quickmarks));
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, isn't the ( in the wrong place? I would have expected

Suggested change
quickmarksFile = optionals (cfg.quickmarks != { }) concatStringsSep "\n"
((mapAttrsToList formatQuickmarks cfg.quickmarks));
quickmarksFile = optionals (cfg.quickmarks != { }) (concatStringsSep "\n"
(mapAttrsToList formatQuickmarks cfg.quickmarks));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me as well, and that's how I initially wrote it. The format utility converted it to this, so i assumed that is prefered.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, optionals doesn't check whether the last argument is actually a list so it returns whatever is on the right, in this case the function concatStringsSep, which is then invoked with the rest.

https://github.com/NixOS/nixpkgs/blob/189a13688782682f2022023c025733bfb269f9d3/lib/lists.nix#L266-L270

{
  optionals =
    # Condition
    cond:
    # List to return if condition is true
    elems: if cond then elems else [];
}

@rycee
Copy link
Member

rycee commented May 31, 2021

Thanks! Looks OK to me. Just had two minor comments.

@IvarWithoutBones IvarWithoutBones force-pushed the fix/qutebrowser-quickmarks branch from 78893d5 to bcf004d Compare May 31, 2021 22:26
@IvarWithoutBones
Copy link
Contributor Author

Would love to get this merged :)

Copy link
Member

@berbiche berbiche left a comment

Choose a reason for hiding this comment

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

LGTM!

@berbiche berbiche merged commit be0e73a into nix-community:master Jun 15, 2021
IvarWithoutBones added a commit to IvarWithoutBones/dotfiles that referenced this pull request Jun 15, 2021
@IvarWithoutBones IvarWithoutBones deleted the fix/qutebrowser-quickmarks branch June 15, 2021 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure qutebrowser quickmarks through home-manager
3 participants