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

Re-add generate-config script #68

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions nix/packages/nix-your-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
inputs,
rustPlatform,
rust-analyzer,
runCommand,
}: let
src = lib.cleanSourceWith {
src = crane-lib.path ../../.;
Expand Down Expand Up @@ -71,10 +72,15 @@
rust-analyzer
];
};
in

generate-config = shell:
runCommand "nix-your-shell-config" {} ''
${lib.getExe pkg} ${lib.escapeShellArg shell} >> "$out"
'';

# Build the actual crate itself, reusing the dependency
# artifacts from above.
crane-lib.buildPackage (commonArgs
pkg = crane-lib.buildPackage (commonArgs
// {
# Don't run tests; we'll do that in a separate derivation.
# This will allow people to install and depend on `ghciwatch`
Expand All @@ -85,7 +91,7 @@ in
cargoBuildCommand = "cargoWithProfile build";

passthru = {
inherit checks devShell;
inherit checks devShell generate-config;
};

meta = {
Expand All @@ -95,4 +101,6 @@ in
platforms = import inputs.systems;
mainProgram = cargoToml.package.name;
};
})
});
in
pkg
Loading