c-project/devenv.nix

49 lines
958 B
Nix
Raw Normal View History

2023-11-28 11:17:34 -05:00
{ 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 = ''
2023-11-28 11:21:22 -05:00
echo "Welcome to the $$NAME development environment."
2023-11-28 11:17:34 -05:00
echo "Bazel version: $(bazel --version | cut -d ' ' -f 2)"
'';
scripts.update-lock.exec = ''
bazel mod deps --lockfile_mode=update
'';
2023-11-28 11:17:34 -05:00
scripts.build.exec = ''
2023-11-28 11:21:22 -05:00
bazel build //main:$$NAME
2023-11-28 11:17:34 -05:00
'';
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/
}