c-project/devenv.nix

45 lines
877 B
Nix

{ pkgs, ... }:
{
# https://devenv.sh/basics/
env.NAME = "$REPO_NAME";
# https://devenv.sh/packages/
packages = with pkgs; [
git
bazel
bazel-buildtools
];
# https://devenv.sh/scripts/
scripts.welcome-banner.exec = ''
echo "Welcome to the $$NAME development environment."
echo "Bazel version: $(bazel --version | cut -d ' ' -f 2)"
'';
scripts.build.exec = ''
bazel build //main:$$NAME
'';
scripts.clean.exec = ''
bazel clean
'';
scripts.clean-build.exec = "clean && build";
enterShell = ''
welcome-banner
'';
# https://devenv.sh/languages/
# languages.nix.enable = true;
# https://devenv.sh/pre-commit-hooks/
# pre-commit.hooks.shellcheck.enable = true;
# https://devenv.sh/processes/
# processes.ping.exec = "ping example.com";
# See full reference at https://devenv.sh/reference/options/
}