Sorry for the brief post, I’m a bit in a rush. I will answer any questions you might have later
I’m still new to nix, so if you could explain it from ground up that would be cool, but not necessary, I can use Google haha (though I couldn’t find an answer to this one) Thanks!
Applying the following diff gets closer, but still appears to fail on the glib crate for some reason adding rustPlatform.bindgenHook didn’t appear to help either.
Also you will want to build this against master or at least nixos-unstable, since master is where PRs will go to first regardless (and nixos-unstable trails it by a couple of days).
Well so much for reproducibility lol. The main branch did build for me a day ago, while the remove-cargolock branch (which is basically the diff you sent me) gives me the above error.
I feel like I’m missing something fundamental, something in my environment? You’re using nix-build -A blink right? I’m going to question everything haha
Can’t really claim reproducibility if your inputs aren’t pinned. That’s why lockfiles exist. npins, nvfetcher, and flakes all allow for pinning the exact revision more ergonomically, or you could specify the exact revision in your default.nix.
BTW I also removed the buildPhase since it’s redundant and is missing the pre/post-phase hooks.
With all that you said, I went back to basics and played around. Instead, I cloned the nixpkgs repo (solves the reproducibility problem) and wrote the nix file from the beginning. With this setup, there was no need for patches and other problem are also gone.
The installPhase probably needs a variable for the system type.
tauriBuildFlags is there because it failed with Error failed to bundle project: - Unable to find a bundled project for the updater otherwise. About that, are binaries enough or does it require a bundle (like deb) for nixpkgs?
It still has some issues (no HE-AAC codec support, I’m guessing)(mesa mismatch between my system and the unstable branch), but those are mine to figure out
You’re looking for stdenv.hostPlatform.rust.cargoShortTarget here.
(You can also drop the mkdir call since install -D takes care of it, but ensure to keep the trailing slash after $out/bin/ or use the -t flag as in -t $out/bin.)
Also, if you did manage to get bundling working, you could even drop the installPhase entirely, since tauriInstallHook expects the app to be bundled.
How do you know what hooks expect or do? Experience or just browsing the source code?
I’m guessing you just copy pasted the error message into GitHub to find the issue? Would the way of searching Nixpkgs GitHub → Nix Discourse → Google be right? As in if I can’t find it in the repo, I search here and then Google?