Skip to content

Support for GitHub/GitLab PR URLs #588

Open
@Gabriella439

Description

One common use case for cabal2nix is using it to fetch a certain pull request for use as a dependency. However, currently one has to manually translate the PR URL to a revision before one can use cabal2nix. It would be nice if one could instead run something like:

$ cabal2nix https://github.com/andrewthad/country/pull/29

… and (at the time of this writing) it would behave the same way as if one had ran:

$ cabal2nix https://github.com/andrewthad/country --revision 4477749919da35e392faf08538f07c4c175b8284

I'd be happy to contribute this change myself if it would be approved. I've already looked into this and seemed like the most idiomatic way to do this would be to first contribute a nix-prefetch-pr utility to Nixpkgs and then make cabal2nix a thin wrapper around that. However, I wouldn't want to open the PR for nix-prefetch-pr if the matching change to cabal2nix would not get approved.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions