nix-community / lorri

Your project’s nix-env [maintainer=@Profpatsch,@nyarly]
Apache License 2.0
677 stars 24 forks source link

add instructions in the readme on how to override lorri's source in nixpkgs with a commit from this repo #89

Closed adrian-gierakowski closed 2 years ago

adrian-gierakowski commented 2 years ago

For people not familiar with rust machinery in nixpkgs

I tried the following overlay:

self: super: {
  lorri = super.lorri.overrideAttrs (old: {
    version = "1.5.0-git-93293c49";
    src = super.fetchFromGitHub {
      owner = "nix-community";
      repo = "lorri";
      rev = "93293c499f697a5db32ba09b2aca02cf8274818b";
      sha256 = "sha256-1M720iuk2Wbn8Ld6BLM9HB6i33VGCUQByIKWl63aog8=";
    };
  });
}

but got

error: builder for '/nix/store/msflraysa15661qib56jafmh8lwnfpqc-lorri-1.5.0-git-93293c49.drv' failed with exit code 1;
       last 10 log lines:
       >
       > ERROR: cargoSha256 is out of date
       >
       > Cargo.lock is not the same in lorri-1.5.0-vendor.tar.gz
       >
       > To fix the issue:
       > 1. Use "0000000000000000000000000000000000000000000000000000" as the cargoSha256 value
       > 2. Build the derivation and wait for it to fail with a hash mismatch
       > 3. Copy the 'got: sha256:' value back into the cargoSha256 field
       >
       For full logs, run 'nix log /nix/store/msflraysa15661qib56jafmh8lwnfpqc-lorri-1.5.0-git-93293c49.drv'.

using 0000000000000000000000000000000000000000000000000000 for cargoSha256 didn't end up giving me the sha256 value promised by the error message

ended up copying the entire https://raw.githubusercontent.com/NixOS/nixpkgs/nixos-unstable/pkgs/tools/misc/lorri dir into my local nixos configuration dir and replacing

version
gitRev
sha256

which finally resulted in a build error giving me the sha256 I could use to replace cargoSha256

Profpatsch commented 2 years ago

Oh, looks like the nixpkgs version of lorri bitrotted away. I’m gonna try and fix it.

Profpatsch commented 2 years ago

Update: it still works, just we had a few updates in master in the meantime.

I’d say strictly speaking we don’t support overwriting the lorri version in nixpkgs, neither do we want to encourage it, so the corresponding docs should probably go into the nixpkgs source tree.

I’m gonna try to push out a new release in the next few days.

adrian-gierakowski commented 2 years ago

thank you for looking into this @Profpatsch

I’d say strictly speaking we don’t support overwriting the lorri version in nixpkgs, neither do we want to encourage it

So how about adding instructions on how to use an unrealeased version of lorri on nixos?