3 ms·
What you are trying to do doesn't look like an overlay, but an override[1]. you can do something like this: let new_electrum = pkgs.electrum.overrid
by takeda 7y ago
What you are trying to do doesn't look like an overlay, but an override[1].
you can do something like this:
let
new_electrum = pkgs.electrum.overrideAttrs (oldAttrs: rec {
name = "${oldAttrs.pname}-${version}";
version = "4.0.0a";
src = fetchurl {
url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz";
sha256=pkgs.lib.fakeSha256;
};
})
in
<then use "new_electrum">
Unfortunately there is no https://download.electrum.org/4.0.0a/Electrum-4.0.0a.tar.gz https://download.electrum.org/4.0.0a/Electrum-4.0.0a.tar.gz so I don't have the hash. So you would need to perhaps correct it. You could invoke this it will fail with an error that hash is wrong and will provide the file hash, then just replace pkgs.lib.fakeSha256 with the hash in quotes.
[1] https://nixos.org/nixpkgs/manual/#sec-pkg-overrideAttrs https://nixos.org/nixpkgs/manual/#sec-pkg-overrideAttrs
Edit: looks like the version is on GitHub, and after I posted seems like you already figured it out, but maybe it can help someone else, typically that's the way to override.
- iso-8859-1 7y agoYou can use GitHub's automatic generation of archives even for specific git commits. There is no version 4.0.0a of Electrum, it has not been released, it is misleading to refer to it.
- takeda 7y agoThere's actually fetchFromGitHub which takes care of it, looks like parent already figured it out: https://news.ycombinator.com/item?id=22883382 https://news.ycombinator.com/item?id=22883382 He also needed to change some dependencies so it's more complex than what I wrote.