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

Fix delay with unfree package set #68

Open
llakala opened this issue Oct 18, 2024 · 3 comments
Open

Fix delay with unfree package set #68

llakala opened this issue Oct 18, 2024 · 3 comments

Comments

@llakala
Copy link
Owner

llakala commented Oct 18, 2024

Currently, my custom nixpkgs instance has one big con: running anything has a three-second delay where it says Copying '/nix/store/HASHCONTENTS-nixpkgs-configured. This doesn't happen when I comment out the key line:

nix.registry.nixpkgs.flake = pkgs.callPackage myLib.mkUnfreeNixpkgs { path = inputs.nixpkgs; };

Here's a comparison.

The line commented out

Screencast.from.2024-10-18.00-48-54.webm

The line included

Screencast.from.2024-10-18.00-45-34.webm

I'm unsure as to why this might be. I thought it was some caching thing that I could replicate with cachix, but no, it works without internet. I'm guessing that somehow the default nixpkgs derivation gets special treatment and is always accessible, while our derivation isn't treated as nicely.

@Frontear, if you have any ideas as to why this is, let me know!

@Frontear
Copy link

I suspect this is due to the lack of a lock file. Something like lazy trees would fix this, but that's not here yet.

@llakala
Copy link
Owner Author

llakala commented Oct 19, 2024

I suspect this is due to the lack of a lock file. Something like lazy trees would fix this, but that's not here yet.

It's always lazy trees...

@llakala
Copy link
Owner Author

llakala commented Oct 19, 2024

For now, this works as a workaround. Only the unfree registries have the ~3-second delay, so I can only use those when actually needed.

nix.registry = lib.mkForce 
{
  nixpkgs.flake = inputs.nixpkgs;
  nixpkgs-unstable.flake = inputs.nixpkgs-unstable;

  # Allow running unfree packages with nix3 commands via `nix run unfree#steam`
  unfree.flake = pkgs.callPackage myLib.mkUnfreeNixpkgs { path = inputs.nixpkgs; };
  unfree-unstable.flake = pkgs.callPackage myLib.mkUnfreeNixpkgs { path = inputs.nixpkgs-unstable; };
};

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

No branches or pull requests

2 participants