TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Nix Derivations, Without Guessing

136 点作者 surprisetalk大约 1 个月前

10 条评论

tikhonj大约 1 个月前
For context, this particular article is a cool deep dive into how Nix <i>works</i>, but it doesn&#x27;t represent what using Nix + Nixpkgs is like in practice. I&#x27;ve been using Nix personally and professionally for almost 10 years now (yikes has time passed quickly!) and I have never needed to operate at the level of derivations like this.
评论 #43639926 未加载
评论 #43640250 未加载
chombier大约 1 个月前
What I found hard with Nix is the sheer amount of things I had to get familiar with before it started to really click:<p>- nix, the command-line tool<p>- nix, the language<p>- nixpkgs with the general API&#x2F;idioms (overriding, overlays)<p>- individual nixpkgs packages that sometimes deviate from common practices<p>- flakes (which I haven&#x27;t properly looked into yet)<p>The Nix pills series [1] and nixpkgs documentation [2] do help a lot, but that is quite a lot to process.<p>[1] <a href="https:&#x2F;&#x2F;nixos.org&#x2F;guides&#x2F;nix-pills" rel="nofollow">https:&#x2F;&#x2F;nixos.org&#x2F;guides&#x2F;nix-pills</a><p>[2] <a href="https:&#x2F;&#x2F;nixos.org&#x2F;manual&#x2F;nixpkgs&#x2F;stable&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nixos.org&#x2F;manual&#x2F;nixpkgs&#x2F;stable&#x2F;</a>
评论 #43642714 未加载
评论 #43642236 未加载
kennethallen大约 1 个月前
I walk away from every article on or attempt to use Nix more mystified
评论 #43639732 未加载
评论 #43639866 未加载
评论 #43642702 未加载
setheron大约 1 个月前
What a fun read. Thanks for the nice call out on my blog.<p>If you&#x27;re also interested I (Farid) also had a follow up where I follow up on how the hashes are calculated. (Using the error to get the hashes also bugged me)<p>I use it to also create vanity hashes :)<p><a href="https:&#x2F;&#x2F;fzakaria.com&#x2F;2025&#x2F;03&#x2F;28&#x2F;what-s-in-a-nix-store-path" rel="nofollow">https:&#x2F;&#x2F;fzakaria.com&#x2F;2025&#x2F;03&#x2F;28&#x2F;what-s-in-a-nix-store-path</a><p><a href="https:&#x2F;&#x2F;fzakaria.com&#x2F;2025&#x2F;03&#x2F;27&#x2F;nix-vanity-store-paths" rel="nofollow">https:&#x2F;&#x2F;fzakaria.com&#x2F;2025&#x2F;03&#x2F;27&#x2F;nix-vanity-store-paths</a>
Joker_vD大约 1 个月前
Ah, don&#x27;t you just like it when projects that use hashsums, calculate them in such a way that you can&#x27;t actually recalculate them on your own? And when you start digging, you find not only that it uses the same basic design of XML-DSig while <i>barely</i> escaping its fatal flaws, it also uses some bizarre data encodings nobody else uses for anything. And then the resulting hash is not even the truncation of the actual hash, it has an additional (again, entirely undocumented) strange post-processing step for unspecified reasons.
pveierland大约 1 个月前
Nix derivations are pretty neat!<p>I&#x27;ve been building a Nix store navigator for MyNixOS v2. It can help you get a feel for how derivations are connected in Nix:<p><a href="https:&#x2F;&#x2F;v2.mynixos.com&#x2F;nix&#x2F;store&#x2F;lsk1c4v03y4lmpxdcwal99nm5nwz2rj7-texlive-2024-env.drv" rel="nofollow">https:&#x2F;&#x2F;v2.mynixos.com&#x2F;nix&#x2F;store&#x2F;lsk1c4v03y4lmpxdcwal99nm5nw...</a><p>PS: The controls to the upper right can be used to limit what is downloaded.
klysm大约 1 个月前
What a bizarre and arcane incantation
danlitt大约 1 个月前
c.f. guix, where the command is simply `guix hash`.
Mayora13大约 1 个月前
Now we are really interested in why they do this—probably for backward compatibility with a 20‑year‑old implementation. It’s not messy, just particular.
klysm大约 1 个月前
Is there any technical pathway for changing the underlying hash function? Similar to how git is kind of stuck on SHA1, what would it take to get this onto SHA512?
评论 #43644264 未加载