29 Dec 2024 |
Luke | I solved my issue using stable anyways - was looking for a window iterator, and thought I needed the nightly feature until I saw Vec has this feature | 06:32:44 |
Tumble | Redacted or Malformed Event | 09:21:31 |
Tumble | sorry wrong chat, i thought i clicked on regular nix chat | 09:22:23 |
30 Dec 2024 |
| cpick joined the room. | 04:01:40 |
| raitobezarius changed their display name from raitobezarius (DECT: 3538 / EPVPN 2681) to raitobezarius. | 16:28:53 |
31 Dec 2024 |
| tilpner changed their display name from tilpner (38c3 3209) to tilpner. | 10:55:11 |
| getchoo changed their profile picture. | 12:38:41 |
| Tanja (she/her) changed their display name from Tanja (she/her) [DECT 6929] to Tanja (she/her). | 20:59:03 |
1 Jan 2025 |
| NixOS Moderation Botchanged room power levels. | 14:26:31 |
2 Jan 2025 |
| antrz joined the room. | 19:37:52 |
antrz | Hi | 19:38:01 |
antrz | can anyone help me install zed-editor preview with overrideAttrs? | 19:38:15 |
Niklas Korz | In reply to @antrz:matrix.org can anyone help me install zed-editor preview with overrideAttrs? You have to override version, src and cargoHash | 19:41:37 |
antrz | Here's what i did:
package = pkgs.zed-editor.overrideAttrs (old: rec {
pname = "zed-editor";
version = "0.168.0";
src = pkgs.fetchFromGitHub {
owner = "zed-industries";
repo = "zed";
tag = "v0.168.0-pre";
hash = "sha256-GcsK64tJrEp1QVcLJV2xTWAzupmNXsMgzzW5KOEFqTI=";
};
cargoDeps = old.cargoDeps.overrideAttrs (
lib.const {
inherit src;
name = "${pname}-x86_64.tar.gz";
outputHash = "sha256-GcsK64tJrEp1QVcLJV2xTWAzupmNXsMgzzW5KOEFqTI=";
}
);
});
| 19:42:28 |
Niklas Korz | Are you on unstable or 24.11? | 19:42:55 |
Niklas Korz | I think the install check will still fail though | 19:43:19 |
antrz | unstable | 19:43:20 |
Niklas Korz | Because we pass the version as an env var | 19:43:28 |
Niklas Korz | And buildRustPackage has no finalAttrs unfortunately | 19:43:40 |
antrz | I see | 19:44:17 |
Niklas Korz | In reply to @antrz:matrix.org unstable In that case remove the cargoDeps and set cargoHash | 19:44:35 |
antrz | Let me show you what i get when i do that | 19:45:06 |
antrz | error: builder for '/nix/store/wyarz7bbc2565kna21g3ixc7x3fvb0na-zed-editor-0.168.0.drv' failed with exit code 1;
last 25 log lines:
> 16812c16536
> < "syn 2.0.90",
> ---
> > "syn 2.0.87",
> 16824c16548
> < "syn 2.0.90",
> ---
> > "syn 2.0.87",
> 16837,16838c16561,16562
> < "syn 2.0.90",
> < "winnow",
> ---
> > "syn 2.0.87",
> > "winnow 0.6.20",
>
> ERROR: cargoHash or cargoSha256 is out of date
>
> Cargo.lock is not the same in /build/zed-editor-0.166.2-vendor
>
> To fix the issue:
> 1. Set cargoHash/cargoSha256 to an empty string: `cargoHash = "";`
> 2. Build the derivation and wait for it to fail with a hash mismatch
> 3. Copy the "got: sha256-..." value back into the cargoHash field
> You should have: cargoHash = "sha256-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=";
>
For full logs, run 'nix log /nix/store/wyarz7bbc2565kna21g3ixc7x3fvb0na-zed-editor-0.168.0.drv'.
error: 1 dependencies of derivation '/nix/store/w1gz7g0h8ma6ay84dglc7jwwc9i6id76-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/5m3xb2jfvafnl7dq55clp33kjcr3difh-home-manager-generation.drv' failed to build
| 19:46:48 |
antrz | That's why i tried cargoDeps because neither the version nor the cargo hash were being set | 19:47:39 |
antrz | Niklas Korz | 19:47:51 |
antrz | Niklas Korz: any ideas? | 19:57:32 |
Toma | I recommend just copying the entire expression and updating the version there, since version is used in a lot of places in the derivation, which cannot be overrideAttrs-ed. | 20:30:44 |
antrz | Like copy the entire derivation?
can you give me an example? I'm a newbie to nixos | 20:33:05 |
Toma | copy the entire package.nix file to somewhere next to your config, and then instead of writing pkgs.zed-editor you write (pkgs.callPackage ./the-copied-file.nix {}) | 20:35:21 |
Toma | and of course, don't forget to update all hashes. | 20:35:46 |