I want to install Anki version 2.1.64 on my system via home-manager (since when I was on Arch Linux only, the version that had decent font rendering was that, in previous versions and current 2.1.65 the sources in Wayland are broken), then try using the following code to install the version I want:
But after running home-manager switch, I get the following error:
error: cannot coerce a set to a string
at /home/anderson/.config/home-manager/home.nix:17:7:
16| version = "2.1.64";
17| sources = {
| ^
18| linux = fetchurl {
(use '--show-trace' to show detailed location information)
So please can someone help me to install this version of Anki?
Post-Data: I don’t speak English, all this text was translated using some translator on the internet, I apologize for any inaccuracies there may be; I’m also a complete newbie to Nix…
That package does not seem very easy to override, most of the code is inside a let ... in.
Instead of wasting your time with bad ways to override it, here is my pragmatic advice: just copy that file into your configuration, modify it and import it like this:
A somewhat curious question, how do you calculate the hash?, because I downloaded the file and used the sha256sum command and pasted the hash, but when I use your solution, Nix complains saying that they do not match (I still put the one that appeared in the message error and it worked).
Post-Data: Thanks for your help, your answer worked perfectly. I had no idea about the existence of the callPackage function.
Most of the time that’s what I do too, except I set the hash to an empty string to guarantee that nix will not pick the incorrect file from the cache, If you change the url, but not the hash, that can happen.