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

flake: avoid ifd #70

Merged
merged 1 commit into from
Feb 20, 2023
Merged

flake: avoid ifd #70

merged 1 commit into from
Feb 20, 2023

Conversation

figsoda
Copy link
Contributor

@figsoda figsoda commented Jan 31, 2023

fixes #52

the ifd was caused by the channel pin, now we are using the latest complete toolchain for fenix. It is still pinned as long as we don't update fenix (with nix flake update)

also removed the gitignore input since it is unused: #45

@oppiliappan
Copy link
Owner

ah i see, thanks for this. is there any way to enforce a certain rust version (maybe using a toolchain.toml file)? i would like to have an explicit rust version setting rather than an implicit one.

@oppiliappan oppiliappan merged commit ec55198 into oppiliappan:master Feb 20, 2023
@NobbZ
Copy link
Contributor

NobbZ commented Feb 20, 2023

I do not know anything about fenix, though with the oxalica overlay it is definitely possible to specify explicit tool-chain versions.

It can be either done by accessing it by attr-path, some function calls with some arguments that specify the version, pretty similar to how it was done here already or IIRC it can even read from the same toolchain.toml that would be maintained by rustup.

@figsoda figsoda deleted the ifd branch February 20, 2023 15:03
@figsoda
Copy link
Contributor Author

figsoda commented Feb 20, 2023

The same things can be done for fenix too with IFD, oxalica's overlay can do this without IFD by including all the rust versions in the repository, but it makes the tarball much larger which needs to be downloaded even if you are just using the most basic features

892K	fenix.tar.gz
23M	oxalica.tar.gz

@figsoda
Copy link
Contributor Author

figsoda commented Feb 20, 2023

I just realized version pinning it actually possible with fenix without IFD utilizing flake inputs, I added an example to the fenix readme

{
  inputs = {
    fenix = {
      url = "github:nix-community/fenix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixpkgs.url = "nixpkgs/nixos-unstable";
    rust-manifest = {
      url = "https://static.rust-lang.org/dist/2022-02-06/channel-rust.toml";
      flake = false;
    };
  };

  outputs = { self, fenix, nixpkgs, rust-manifest }: {
    packages.x86_64-linux.default =
      (fenix.packages.x86_64-linux.fromManifestFile rust-manifest).minimalToolchain;
  };
}

But in this case the current solution should do, since the flake is not updated very often

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.

Building statix requires IFD
3 participants