Skip to content

Commit 7d487c8

Browse files
committed
cli: Expose Nix release package and runnable app outputs
Add nested flake outputs for packaged release usage by defining `packages.sce`, `packages.default`, and `apps.sce` for the `sce` binary.
1 parent a6ca74b commit 7d487c8

9 files changed

Lines changed: 55 additions & 6 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.direnv/
22
node_modules/
33
cli/target/
4+
result*

cli/flake.nix

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
overlays = [ rust-overlay.overlays.default ];
2424
};
2525

26+
src = builtins.path {
27+
path = ../.;
28+
name = "source";
29+
};
30+
2631
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
2732
extensions = [ "rustfmt" ];
2833
};
@@ -31,15 +36,36 @@
3136
cargo = rustToolchain;
3237
rustc = rustToolchain;
3338
};
39+
40+
scePackage = rustPlatform.buildRustPackage {
41+
pname = "sce";
42+
version = "0.1.0";
43+
inherit src;
44+
sourceRoot = "source/cli";
45+
46+
cargoLock = {
47+
lockFile = ../cli/Cargo.lock;
48+
};
49+
50+
nativeBuildInputs = [ rustToolchain ];
51+
doCheck = false;
52+
};
3453
in
3554
{
55+
packages = {
56+
sce = scePackage;
57+
default = scePackage;
58+
};
59+
60+
apps.sce = {
61+
type = "app";
62+
program = "${scePackage}/bin/sce";
63+
};
64+
3665
checks.cli-setup-command-surface = rustPlatform.buildRustPackage {
3766
pname = "sce-cli-setup-command-surface-check";
3867
version = "0.1.0";
39-
src = builtins.path {
40-
path = ../.;
41-
name = "source";
42-
};
68+
inherit src;
4369
sourceRoot = "source/cli";
4470

4571
cargoLock = {

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: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

context/context-map.md

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

context/glossary.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/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: 1 addition & 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: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)