Skip to content

Create flake.nix for CLI#733

Merged
DaAlbrecht merged 21 commits intomainfrom
cli-flake.nix
Apr 6, 2026
Merged

Create flake.nix for CLI#733
DaAlbrecht merged 21 commits intomainfrom
cli-flake.nix

Conversation

@BD103
Copy link
Copy Markdown
Member

@BD103 BD103 commented Feb 4, 2026

This is adopted from #532, huge thank you to @CupOfTeaJay!

@BD103 BD103 added A-CLI Related to the main CLI and not a more specific subcommand A-Build-System Related to CI and GitHub Actions X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes O-Linux labels Feb 4, 2026
@BD103 BD103 enabled auto-merge (squash) February 4, 2026 03:56
@BD103 BD103 mentioned this pull request Feb 4, 2026
@BD103 BD103 disabled auto-merge February 4, 2026 04:09
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
doCheck = false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cargoBuildFlags = [ "--all" ];

You need --all so that bevy_lint also gets built.

cargoLock.lockFile = ./Cargo.lock;
doCheck = false;

nativeBuildInputs = nativeBuildInputs ++ (with pkgs; [ makeBinaryWrapper ]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

postInstall = ''
  for bin in $out/bin/bevy{,_lint}; do
    wrapProgram $bin --set BEVY_LINT_SYSROOT ${toolchain}
  done
'';

BEVY_LINT_SYSROOT wrapper is necessary here, so that it can function on a non-rustup system.

@DaAlbrecht DaAlbrecht added the S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged label Mar 29, 2026
@foob2483-oss
Copy link
Copy Markdown

Any blockers on this PR? The fixes above are very straightforward, so I'm not sure why it's getting stalled for months.

Co-authored-by: musjj <musjj@users.noreply.github.com>
@DaAlbrecht
Copy link
Copy Markdown
Collaborator

DaAlbrecht commented Apr 4, 2026

@foob2483-oss @musjj Could you test again if i applied the suggestions correctly? If so i will merge thanks! Never mind CI is failing now ^^ im more than happy if someone adopts this!

@DaAlbrecht DaAlbrecht requested a review from musjj April 4, 2026 10:17
@musjj
Copy link
Copy Markdown
Contributor

musjj commented Apr 5, 2026

You just need to run nix flake update to update the lockfile. Its current database of nightly versions is outdated so it doesn't include 2026-03-05.

Copy link
Copy Markdown
Contributor

@musjj musjj left a comment

Choose a reason for hiding this comment

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

I've tested it and it works! You can test it yourself on your local project like this:

$ nix run github:TheBevyFlock/bevy_cli/cli-flake.nix -- lint

@DaAlbrecht
Copy link
Copy Markdown
Collaborator

I've tested it and it works! You can test it yourself on your local project like this:

$ nix run github:TheBevyFlock/bevy_cli/cli-flake.nix -- lint

Thanks for testing! I don't have nix installed but I will merge this!

@DaAlbrecht DaAlbrecht merged commit 80d0ca4 into main Apr 6, 2026
11 checks passed
@DaAlbrecht DaAlbrecht deleted the cli-flake.nix branch April 6, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Build-System Related to CI and GitHub Actions A-CLI Related to the main CLI and not a more specific subcommand D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes O-Linux S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants