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

Nix flake #609

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Nix flake #609

wants to merge 4 commits into from

Conversation

Eveeifyeve
Copy link

@Eveeifyeve Eveeifyeve commented Mar 5, 2025

Description

  • Followup from pr Nix flake #283 to take over from @nicholaschiasson comment
  • Adds nix flake
  • Changed nix flake to use flake parts over utils and flake compact for old nix compatibility
  • Adds back the cargo lock file which is needed for nix run package and recommended by rust team.

Testing

N/A since there is no code change.
I simply ran nix run locally to test that it is working.

Please follow our Coding Guidelines

As it's now reccomended by rust team to keep it in repo as well as nix
needs it fetch dependacies for nix run
I forgot to add it that's why this commit is here.
@Eveeifyeve
Copy link
Author

I have one more thing to do for this pr and that is adding an github action to update the flake.lock over time.

@Eveeifyeve
Copy link
Author

Finished. Note this will open a PR every time this updates.

@kralverde
Copy link
Contributor

kralverde commented Mar 5, 2025

I'm not a nix user but I'm seeing a lot of relative paths in the script, is there away to anchor them to the script's directory?

Also I'm not a big fan of the workflow (as a concept) why do you need periodic automatic updates? Can you just add a contrib/script to re-generate the file that's ran as needed?

@Eveeifyeve
Copy link
Author

Eveeifyeve commented Mar 5, 2025

I'm not a nix user but I'm seeing a lot of relative paths in the script, is there away to anchor them to the script's directory?

No sadly since it requires the same versions for the flake compact and paths needed for package is required for version and name and toolchain

Also I'm not a big fan of the workflow (as a concept) why do you need periodic automatic updates? Can you just add a contrib/script to re-generate the workflow that's ran as needed?

Because of dependancy changes from nixpkgs and rust-overlay I wanted to do this so you would have developers worrying about updates to dependancy updates with flakes everything is locked to what is specified in flake.lock like cargo lock but it doesn’t update until you do nix flake update.

@nicholaschiasson
Copy link

Isn't it a better idea to only ever intentionally update the flake lock file and manually check that into version control? I would think that having it automatically updated on a cron workflow could introduce breaking dependencies accidentally sometimes, and not to mention maintainers using the flake locally would be forced to move to a new derivation much more often, which is perhaps not a huge problem but a little inconvenient imo. Is this best practice for flakes right now?

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