Skip to content

Commit 9bb5cda

Browse files
committed
infra: Ensure root flake evaluates nested CLI rust-overlay wiring
Forward `rust-overlay` through root flake inputs into the nested `cli` flake and refresh lock wiring so root `nix flake check` can evaluate CLI checks. Also add app metadata descriptions and reuse setup embedded-asset iterator in install flow to remove non-blocking check/build warnings.
1 parent e7cbb69 commit 9bb5cda

10 files changed

Lines changed: 104 additions & 16 deletions

File tree

cli/flake.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
apps.sce = {
6161
type = "app";
6262
program = "${scePackage}/bin/sce";
63+
meta = {
64+
description = "Run the packaged sce CLI";
65+
};
6366
};
6467

6568
checks.cli-setup-command-surface = rustPlatform.buildRustPackage {

cli/src/services/setup.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,12 @@ where
170170

171171
for concrete_target in concrete_targets_for(target) {
172172
let concrete_target = *concrete_target;
173-
let assets = assets_for_target(concrete_target);
173+
let assets: Vec<&'static EmbeddedAsset> =
174+
iter_embedded_assets_for_setup_target(concrete_target).collect();
174175
let result = install_assets_for_concrete_target_with_rename(
175176
repository_root,
176177
concrete_target,
177-
assets,
178+
&assets,
178179
&mut rename_fn,
179180
)?;
180181
target_results.push(result);
@@ -186,7 +187,7 @@ where
186187
fn install_assets_for_concrete_target_with_rename<F>(
187188
repository_root: &Path,
188189
target: SetupTarget,
189-
assets: &'static [EmbeddedAsset],
190+
assets: &[&'static EmbeddedAsset],
190191
rename_fn: &mut F,
191192
) -> Result<SetupInstallTargetResult>
192193
where
@@ -247,7 +248,7 @@ where
247248
})
248249
}
249250

250-
fn write_assets_to_staging(staging_root: &Path, assets: &'static [EmbeddedAsset]) -> Result<()> {
251+
fn write_assets_to_staging(staging_root: &Path, assets: &[&'static EmbeddedAsset]) -> Result<()> {
251252
for asset in assets {
252253
validate_embedded_relative_path(asset.relative_path)?;
253254
let destination = staging_root.join(asset.relative_path);
@@ -363,14 +364,6 @@ fn concrete_targets_for(target: SetupTarget) -> &'static [SetupTarget] {
363364
}
364365
}
365366

366-
fn assets_for_target(target: SetupTarget) -> &'static [EmbeddedAsset] {
367-
match target {
368-
SetupTarget::OpenCode => OPENCODE_EMBEDDED_ASSETS,
369-
SetupTarget::Claude => CLAUDE_EMBEDDED_ASSETS,
370-
SetupTarget::Both => unreachable!("both is not a concrete embedded target"),
371-
}
372-
}
373-
374367
fn cleanup_path_if_exists(path: &Path) {
375368
let cleanup_result = if path.is_dir() {
376369
fs::remove_dir_all(path)

context/architecture.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/cli/placeholder-foundation.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/glossary.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/overview.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/patterns.md

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/plans/cli-rust-overlay-release-installability.md

Lines changed: 45 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.lock

Lines changed: 39 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
66
flake-utils.url = "github:numtide/flake-utils";
7+
rust-overlay.url = "github:oxalica/rust-overlay";
78
cli.url = "path:./cli";
89
cli.inputs.nixpkgs.follows = "nixpkgs";
910
cli.inputs.flake-utils.follows = "flake-utils";
11+
cli.inputs.rust-overlay.follows = "rust-overlay";
1012
};
1113

1214
outputs =
1315
{
1416
self,
1517
nixpkgs,
1618
flake-utils,
19+
rust-overlay,
1720
cli,
1821
}:
1922
flake-utils.lib.eachDefaultSystem (
@@ -214,6 +217,9 @@
214217
apps.sync-opencode-config = {
215218
type = "app";
216219
program = "${syncOpencodeConfigApp}/bin/sync-opencode-config";
220+
meta = {
221+
description = "Regenerate and sync config/.opencode outputs";
222+
};
217223
};
218224

219225
devShells.default = pkgs.mkShell {

0 commit comments

Comments
 (0)