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

Add nixpkgs follows example #333

Open
bburdette opened this issue Oct 30, 2024 · 0 comments
Open

Add nixpkgs follows example #333

bburdette opened this issue Oct 30, 2024 · 0 comments

Comments

@bburdette
Copy link

TLDR: would be nice to have an example of nixpkgs.follows usage since naersk seems to default to an old nixpkgs with an old cargo version.

I've been working on a project lately that needs cargo --version to be 1.70 or greater.

With nix develop my flake would show cargo of 1.83, but when I did nix build the naersk build would fail.

Examining my flake.lock, it turns out a 2023 nixpkgs was being pulled in from someplace. This is probably where the old cargo was coming from. Commenting out naersk from the flake made that obsolete nixpkgs dependency go away.

The solution was to add a follows to my flake inputs, like so:

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
    flake-utils.url = "github:numtide/flake-utils";
    naersk.url = "github:nix-community/naersk";
    naersk.inputs.nixpkgs.follows = "nixpkgs";
  };

This seems like essential knowledge for folks using naersk to have, so it would be great to have an example added to the README to make it easier to figure out.

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

1 participant