this post was submitted on 15 Jan 2026
1 points (100.0% liked)

Nix / NixOS

2759 readers
2 users here now

Main links

Videos

founded 3 years ago
MODERATORS
 

My config: https://github.com/Aesistril/nixos-config

I am on Microsoft Surface Pro 9. It requires a custom kernel which needs to be compiled in the case of NixOS.

I added the kernel to my config according to the instructions provided in nix-hardware repo. Then I installed nix package manager on Fedora and started compiling in the background while I did some other work. The idea was to push it to cachix so my NixOS install could pull it without needing to compile.

The problem is kernel being compiled on different installations of nix package manager results in different hashes, even when they are using identical configs. It does not pull from cachix which i am sure i set up correctly.

https://aesis-cache-surface.cachix.org/ is my cache.

As a test I did a full, successful, build. Pushed the results to cachix. mv'd the resulting /nix directory to /nix.success.

/nix/store/yg3hr2jl4bq0c6bkchajnszza9vi9vm8-linux-6.15.9 is the result of nix.success and the version stored in the cache

And after running mv I did a second build. Instead of pulling from cachix; it started building this, which is the same thing but with as different hash.

/nix/store/873nppq3pby37w9jxiw6vbv87fczynx2-linux-6.15.9.drv

And yes the git tree was clean and there was absolutely no warnings during nix build. It just misses the cache for some reason

Unrelatedly, nix pulls gnome-desktop even when my DE is set to KDE. I am not sure why.

top 3 comments
sorted by: hot top controversial new old
[–] Morphit@feddit.uk 0 points 4 months ago (1 children)

Not sure I can help with caching but you're confusing the derivation and build result. Both end up in the nix store but the derivations are just files with the .drv extension. The build artefacts have a hash based on the derivation, but it is different. I think they are both deterministic as long as you don't change config or update channel/flake dependencies. Can you check both paths in the nix store and try rebuilding?

[–] cathodebirdtube@lemmy.blahaj.zone 0 points 4 months ago* (last edited 4 months ago) (1 children)

No, I know what .drv means. Its there because i copied a line from the terminal. I tried rebuilding with the exact same, clean git tree and it still did not pull from cachix.

I am guessing there is probably some things in the kernel that depend of build date but I didn't confirm my hypothesis by diffing .drv files. Instead I just used nixos-generators to build a raw disk image on fedora and flashed it with dd

It works

[–] balsoft@lemmy.ml 0 points 4 months ago

The .drv file and the output will have different hashes in their paths, that's normal. You need to compare either the derivations or the outputs, they hashes should match there for everything to work.

Are you sure you've set up the cachix correctly on your laptop?