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

fetchers should be overridable #94201

Open
lilyball opened this issue Jul 29, 2020 · 2 comments
Open

fetchers should be overridable #94201

lilyball opened this issue Jul 29, 2020 · 2 comments
Labels

Comments

@lilyball
Copy link
Member

Describe the bug
None of the fetchers that I've looked at so far support overriding the fetch arguments. This is rather annoying when trying to override derivations that use them, as I need to repeat the original fetcher in my override instead of merely overriding the arguments I want to change.

This could be solved by wrapping all of the fetchers with lib.makeOverridable. I don't know what the performance implications are of turning these functions into functors instead, but I would hope it's negligible.

I was going to simply submit a PR for this, but we have a lot more fetchers than I thought, and I didn't want to do that work unless I knew it would be accepted.

As an example, if I want to change the version of ffsend, right now I have to write

ffsend.overrideAttrs (super: rec {
  version = "0.2.64";
  cargoSha256 = "…";
  src = fetchFromGitLab {
    owner = "timvisee";
    repo = "ffsend";
    rev = "v${version}";
    sha256 = "…";
  };
})

This is repeating stuff that I really shouldn't have to do here, including the fact that ffsend uses GitLab instead of GitHub, and the repo/owner. I should be able to instead write

ffsend.overrideAttrs (super: rec {
  version = "0.2.64";
  cargoSha256 = "…";
  src = super.src.override {
    rev = "v${version}";
    sha256 = "…";
  };
})

And with the mkDerivation changes proposed in #94198 that would shrink even further to

ffsend.overrideAttrs (super: {
  version = "0.2.64";
  cargoSha256 = "…";
  src = super.src.override {
    sha256 = "…";
  };
})
@lilyball lilyball added the 0.kind: bug Something is broken label Jul 29, 2020
@stale
Copy link

stale bot commented Jan 30, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 30, 2021
@Atemu
Copy link
Member

Atemu commented Feb 20, 2022

Still important to me.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants