Skip to content

Commit

Permalink
noop(ci/cd) share nix config to let develop in same env
Browse files Browse the repository at this point in the history
  • Loading branch information
jzacsh committed Jan 13, 2025
1 parent 6a8f59c commit 0498ec7
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ $ RUSTFLAGS='-Ddeprecated -Dwarnings' cargo watch \
# there's compiler errors you're trying to read.
```

NOTE: running `nix-shell` at the root of this repo will enter you in to you
subshell with all the necessary dev tools (see `./shell.nix`). This will let you
easily run anything you find in the ci/cd yaml scripts (`./.gitlab-ci.yml`).

### Tests

e2e tests of the CLI binary, in `vcsq-cli/tests/`, are the strategy for the moment;
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "stable"
48 changes: 48 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
pkgs ? import <nixpkgs> { },
}:
let
overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
in
pkgs.callPackage (
{
stdenv,
mkShell,
rustup,
rustPlatform,


#
# Packages specific to vcsq
#

#
# Packages specific to vcsq's domain
#
git,
mercurial,
jujutsu,

#
# Packages specific to vcsq's ci/cd tasks
#
cargo-llvm-cov, # for test coverage
cargo-binutils,
}:
mkShell {
strictDeps = true;
nativeBuildInputs = [
rustup
rustPlatform.bindgenHook
];
# libraries here
buildInputs = [
];
RUSTC_VERSION = overrides.toolchain.channel;
# https://github.com/rust-lang/rust-bindgen#environment-variables
shellHook = ''
export PATH="''${CARGO_HOME:-~/.cargo}/bin":"$PATH"
export PATH="''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-${stdenv.hostPlatform.rust.rustcTarget}/bin":"$PATH"
'';
}
) { }

0 comments on commit 0498ec7

Please sign in to comment.