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 package flake #685

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Add package flake #685

merged 1 commit into from
Oct 10, 2024

Conversation

Ben-PH
Copy link
Contributor

@Ben-PH Ben-PH commented Oct 9, 2024

This means that someone using nix can add this to their flake inputs:

    dora-rs = {
      url = "github:dora-rs/dora";
      inputs.nixpkgs.follows = "nixpkgs";
    };

and that allows them to add dora-cli, v0.3.6, as one of the declared packages of the system.

This is the first step towards adding dora to the nix package repo.

Copy link
Collaborator

@haixuanTao haixuanTao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe making the step use:

cargo install dora-cli --locked

Might make this file simpler and remove the need to fetch from github, having to copy around binaries.

What do you think?

In the likes of: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#buildrustpackage-compiling-rust-applications-with-cargo-compiling-rust-applications-with-cargo

{ lib, fetchFromGitHub, rustPlatform }:

rustPlatform.buildRustPackage rec {
  pname = "ripgrep";
  version = "12.1.1";

  src = fetchFromGitHub {
    owner = "BurntSushi";
    repo = pname;
    rev = version;
    hash = "sha256-+s5RBC3XSgb8omTbUNLywZnP6jSxZBKSS1BmXOjRF8M=";
  };

  cargoHash = "sha256-jtBw4ahSl88L0iuCXxQgZVm1EcboWRJMNtjxLVTtzts=";

  meta = {
    description = "Fast line-oriented regex search tool, similar to ag and ack";
    homepage = "https://github.com/BurntSushi/ripgrep";
    license = lib.licenses.unlicense;
    maintainers = [ ];
  };
}

@Ben-PH
Copy link
Contributor Author

Ben-PH commented Oct 10, 2024

I'll give that a try

@Ben-PH
Copy link
Contributor Author

Ben-PH commented Oct 10, 2024

not a adding the install step means that the system doesn't have access to the binary. I'm not entirely sure why that's the case, as distributing rust binaries is not a rabbit hole I've dived down, but I suspect it relates to the install-from-source instruction where you build a package and add target/release/dora to PATH. I tried just with the install step, and not the build step, but had trouble finding where the dora binary was outputted to. Adding the build step meant it was easily found in target/release/

Maybe making the step use cargo install dora-cli --locked

I'm not exactly sure what you mean by this.

@haixuanTao
Copy link
Collaborator

I understand thanks for trying!

I'll merge it in that case as is :)

Thanks a lot :)

@haixuanTao haixuanTao merged commit e2b469b into dora-rs:main Oct 10, 2024
40 checks passed
@Ben-PH
Copy link
Contributor Author

Ben-PH commented Oct 10, 2024

I'll put it to the test today, and report back.

I'll also probably need to add some CI/CD stuff to make sure that the nix-install approach works.

Thanks for the merge :)

Ben-PH added a commit to Ben-PH/dora-rs.github.io that referenced this pull request Oct 10, 2024
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.

2 participants