Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid duplicating nixpkgs in the nix store #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrewhamon
Copy link

@andrewhamon andrewhamon commented Dec 11, 2024

I noticed that this line was making my nix evaluations significantly slower. It turns out that simply evaluating "${pkgs.path}" causes nixpkgs to be copied into the nix store an extra time.

e.g. notice the two different paths here:

nix-repl> pkgs.path
/nix/store/p69bcs7ma6ijj8v9xsrg3nq3nn8ryn95-source

nix-repl> "${pkgs.path}"
"/nix/store/aj917y3jd6srg7jfmhgwglbfx36l5h9b-p69bcs7ma6ijj8v9xsrg3nq3nn8ryn95-source"

I'm not sure if this is a problem when running under flakes, but I am consuming this in a repo that is too big to enable flakes with. EDIT: I believe that flakes do suffer the extra copy, but its much less noticeable due to flake evaluation caching.

I noticed that this line was making my nix evaluations significantly slower. It turns out that simply evaluating  `"${pkgs.path}"` causes nixpkgs to be copied into the nix store twice.

e.g. notice the two different paths here:

```
nix-repl> pkgs.path
/nix/store/p69bcs7ma6ijj8v9xsrg3nq3nn8ryn95-source

nix-repl> "${pkgs.path}"
"/nix/store/aj917y3jd6srg7jfmhgwglbfx36l5h9b-p69bcs7ma6ijj8v9xsrg3nq3nn8ryn95-source"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant