reddit-magnet/nix/shell.nix
Marc Plano-Lesay 2ba76b49e8
Some checks failed
Checking Renovate configuration / validate (pull_request) Successful in 17s
Checking yaml / Run yamllint (pull_request) Failing after 14s
Build and test / Generate Documentation (pull_request) Successful in 3m33s
Build and test / Tests (pull_request) Successful in 3m56s
Build and test / Build AMD64 (pull_request) Successful in 4m19s
Build and test / Clippy (pull_request) Successful in 4m33s
chore: migrate to Forgejo
2025-11-05 17:30:07 +11:00

42 lines
1 KiB
Nix

{ lib, pkgs, rust-toolchain, self, ... }:
{
default = pkgs.mkShell {
name = "reddit-magnet";
buildInputs = with pkgs; [
cargo
cargo-edit
cargo-insta
cargo-machete
cargo-release
cargo-sort
diesel-cli
git-cliff
openssl
pkg-config
rustc
rust-toolchain
sqlfluff
sqlite
sccache
] ++ lib.optionals stdenv.isDarwin [
libiconv
] ++ self.checks.${pkgs.system}.pre-commit-check.enabledPackages;
RUST_BACKTRACE = 1;
RUSTC_WRAPPER = lib.getExe pkgs.sccache;
# Copy rust-toolchain to project directory for easy use in IntelliJ
shellHook = ''
if [ -L ./.rust-toolchain ] && [ "$(readlink ./.rust-toolchain)" = "${rust-toolchain}" ]; then
echo "Rust toolchain symlink is already correct."
else
rm -f ./.rust-toolchain
ln -s ${rust-toolchain} ./.rust-toolchain
echo "Rust toolchain symlink updated."
fi
${self.checks.${pkgs.system}.pre-commit-check.shellHook}
'';
};
}