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

CI configs: add nix flake #1815

Merged
merged 5 commits into from
Jan 3, 2025
Merged

CI configs: add nix flake #1815

merged 5 commits into from
Jan 3, 2025

Conversation

aca
Copy link
Contributor

@aca aca commented May 25, 2024

elvish is already packaged in nix, but adding flake file in the project can provide reproducible build, develop environment.
And helpful for someone who wants to package any version of elvish they want (nightly build or even fork..).

gomod2nix.toml Outdated

[mod]
[mod."github.com/creack/pty"]
version = "v1.1.21"
Copy link
Contributor

Choose a reason for hiding this comment

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

How will this dependency data be kept in sync with the go.mod file? If someone submits a change that updates the version of any of these packages (which I have done more than once) do they also have to update this file or is file somehow automatically kept in sync with the go.mod file for the project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has to be updated together with the command
nix develop --command gomod2nix.

If adding flake is OK, I'll try to add workflow that generates automatic PR when dependancy changes.

@xiaq
Copy link
Member

xiaq commented Sep 26, 2024

Hi, sorry for not getting to this. I've wanted to try Nix for a while, so I've been sitting on this PR thinking that I'd get to it once I learned enough Nix to understand what's going on. But it's taken a bit too long, so I thought I should at least post a response.

I try to ensure that I can maintain the entire Elvish codebase, so in general I don't accept code that I don't fully understand unless there's a very compelling reason to do so. Can you tell me:

  • I see there's already an Elvish package in nixpkgs. What's the relationship between it and this PR?

  • Can the files in the PR reasonably live in a separate repo?

@aca
Copy link
Contributor Author

aca commented Dec 10, 2024

Nix definition declared inside nixpkgs has fixed reference (official elvish release version) of elvish.

With flake.nix inside the project, any user who have nix package manager installed (not nixOS) can test nightly verison of elvish with single command.
nix run "github:elvish/elvish/master#elvish"

Elvish developer can also have fixed development environment with flake.nix

git clone https://github.com/elves/elvish && cd elvish 
nix develop # which can be automated with direnv

Will install all dependanices like go, gopls, gofumpt and so on.

I've found some go project like templ which uses nix extensively.

nix-community maintains flake in seperate repo for some projects like
https://github.com/nix-community/neovim-nightly-overlay
But reason this repository exists is solely to provide the lately version of the binary.

@xiaq
Copy link
Member

xiaq commented Jan 3, 2025

Thanks. I made some updates on the branch itself.

@xiaq xiaq merged commit 8737735 into elves:master Jan 3, 2025
11 of 15 checks passed
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.

3 participants