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

Consider making it easier to use without flakes and overlays #209

Open
CobaltCause opened this issue Feb 22, 2025 · 1 comment
Open

Consider making it easier to use without flakes and overlays #209

CobaltCause opened this issue Feb 22, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@CobaltCause
Copy link

Assuming rust-overlay is bound to a path to the rust-overlay source, and nixpkgs is bound to an imported nixpkgs instance, currently you have to do this:

nixpkgs.lib.fixedPoints.fix (rust-bin:
  import "${rust-overlay}/lib/rust-bin.nix" {
    inherit (nixpkgs) lib pkgs;
    inherit (rust-bin) nightly;
    manifests = import "${rust-overlay}/lib/manifests.nix" {
      inherit (nixpkgs) lib;
      distRoot = import "${rust-overlay}/lib/dist-root.nix";
    };
  }
)

which is a mouthful, and I suspect these file paths and such are not considered public API. It would be nice to be able to use this more easily without flakes and overlays.

@oxalica oxalica added the enhancement New feature or request label Feb 22, 2025
@oxalica
Copy link
Owner

oxalica commented Feb 28, 2025

If you accept manually fixing the overlay (but without re-instantiating nixpkgs), it is simpler to use public overlay entry point default.nix:

{ lib, pkgs, rust-overlay }:
let 
  rust-bin = (lib.fix (final: pkgs // (import rust-overlay) final pkgs)).rust-bin;
in
  /*..*/

We can also extract lib.mkRustBin from flake into another public entry point file, eg a root /rust-bin.nix. It should be easy since it does not relying on any flake mechanics. PR is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants