!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

586 Members
Rust129 Servers

Load older messages


SenderMessageTime
4 Jun 2025
@etehtsea:matrix.orgkis-kis joined the room.17:02:29
@k900:0upti.meK900
src = newSrc;
cargoDeps = old.cargoDeps.override {
    src = newSrc;
    hash = "";
}
17:06:04
@k900:0upti.meK900Should work17:06:05
@x10an14:matrix.orgx10an14 That's how you set cargoHash? By not setting it? How do those who've set it in nixpkgs figured out which hash to set? 17:33:19
@k900:0upti.meK900You set it to an empty string, then let the build fial17:38:29
@k900:0upti.meK900* You set it to an empty string, then let the build fail17:38:31
@k900:0upti.meK900And it'll tell you what hash you got17:38:35
@k900:0upti.meK900That's how pretty much every complex FOD works17:38:51
@x10an14:matrix.orgx10an14What I've been trying to say, from my original message of today, is that I get the error, but not the correct hash. Allow me to demonstrate with paste I have to prepare... 18:02:13
@x10an14:matrix.orgx10an14

https://paste.sr.ht/~x10an14/c7aaeba875e9d1f3c85253582c91f6463a9a9f7d

That package doens't have cargoDeps set though, so I'm gonna try the same w/kickoff

18:16:49
@x10an14:matrix.orgx10an14 And here's another one that says old.cargoDeps.override is missing!
https://paste.sr.ht/~x10an14/0306fe76b9bfde4e77d1e91b279a5234c7a57abb
18:28:12
@x10an14:matrix.orgx10an14 This package does implement finalAttrs 18:28:36
@x10an14:matrix.orgx10an14Redacted or Malformed Event18:55:40
@x10an14:matrix.orgx10an14 Another smaller MWE demonstrating the (dis)utility of cargoHash, I can't understand how to use it. Apologies for the screenshot, I figured all 3 panes were relevant information 18:55:40
@x10an14:matrix.orgx10an14Forgot the moderation bot did that18:56:53
@x10an14:matrix.orgx10an14Here's an (~month ttl) upload of the screenshot: http://p.krebsco.de/0fv815l18:59:14
@k900:0upti.meK900 You can do cargoDeps = rustPlatform.fetchCargoVendor { src = newSrc; hash = ""; } 18:59:20
@x10an14:matrix.orgx10an14

As you can see in my previous message's screenshot, I tried that, to no avail. I commented it out after I got the required hash, because my end goal is to figure out how to find cargoHash - I assumed you meant that cargoHash == cargoDeps.hash.

Here's the nix code copied in this time

diff --git a/home-manager/default.nix b/home-manager/default.nix
index ce1dfb5..278eef1 100644
--- a/home-manager/default.nix
+++ b/home-manager/default.nix
@@ -1,4 +1,4 @@
-{ ... }:
+{ pkgs, ... }:
 {
   imports = [
     ./machine-configs
@@ -7,6 +7,25 @@
     ./programs/gui
     ./programs/terminal
   ];
+  home.packages = [
+    (pkgs.kickoff.overrideAttrs (old: rec {
+      # version = "k900-demo";
+      # src = pkgs.fetchFromGitHub {
+      #   owner = "j0ru";
+      #   repo = "kickoff";
+      #   rev = "fe09c4cb2665cfd659844603ea7ade69d1827a3a";
+      #   hash = "sha256-V4MkVjg5Q8eAJ80V/4SvEIwjVy35/HVewaR1caYLguw=";
+      # };
+      # useFetchCargoVendor = true;
+      # cargoHash = "";
+      cargoHash = "sha256-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
+      # cargoHash = "sha256-bkum6NOQL0LVsLvOmKljFHE86ZU3lLDR8+I3wL0Efmk=";
+      # cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
+      #   inherit src;
+      #   hash = "sha256-bkum6NOQL0LVsLvOmKljFHE86ZU3lLDR8+I3wL0Efmk=";
+      # };
+    }))
+  ];
   home.sessionVariables = {
     DOTNET_CLI_TELEMETRY_OUTPUT = 1;
   };
19:02:40
@k900:0upti.meK900 You don't set cargoHash at all in that case 19:05:26
@k900:0upti.meK900 You just override cargoDeps directly 19:05:31
@x10an14:matrix.orgx10an14 Fine, I can accept that a workable override is to ignore cargoHash, and set cargoDeps as instructed. 19:06:03
@x10an14:matrix.orgx10an14 How can I figure out what to set cargoHash to? 19:06:22
@k900:0upti.meK900You don't19:14:02
@k900:0upti.meK900 You just set cargoDeps 19:14:05
@k900:0upti.meK900 cargoHash gets converted to cargoDeps internally 19:14:17
@x10an14:matrix.orgx10an14 So if I want to author a buildRustPackage in nixpkgs, I don't set cargoHash, I set cargoDeps. That's what you're saying? In other words, all cargoHashes are something like technical debt pt? 19:15:48
@k900:0upti.meK900No19:16:13
@k900:0upti.meK900 You can set cargoHash 19:16:18
@k900:0upti.meK900 But overrides set cargoDeps 19:16:24
@k900:0upti.meK900Because overriding is weird and jank19:16:30

Show newer messages


Back to Room ListRoom Version: 6