Added flake, and upated dot files.

This commit is contained in:
Leonardo Romor 2025-05-07 15:34:55 +02:00 committed by qijia
parent 5e96a82794
commit e0881ecf65
No known key found for this signature in database
GPG key ID: 236267CAA32A4F62
3 changed files with 78 additions and 0 deletions

1
.bazelignore Normal file
View file

@ -0,0 +1 @@
.direnv

8
.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
# Misc
/.direnv
/.envrc
# Bazel
bazel-*
MODULE.bazel.lock

69
flake.nix Normal file
View file

@ -0,0 +1,69 @@
{
description = "fpga-assembler";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/2c8d3f48d33929642c1c12cd243df4cc7d2ce434";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}@inputs:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
};
common = with pkgs; {
bazel = bazel_7;
jdk = jdk;
};
in
{
devShells.default =
let
# There is too much volatility between even micro-versions of
# newer clang-format. Use slightly older version for now.
clang_for_formatting = pkgs.llvmPackages_17.clang-tools;
# clang tidy: use latest.
clang_for_tidy = pkgs.llvmPackages_18.clang-tools;
in
with pkgs;
pkgs.mkShell {
packages = with pkgs; [
git
common.bazel
common.jdk
bash
gdb
# For clang-tidy and clang-format.
clang_for_formatting
clang_for_tidy
# For buildifier, buildozer.
bazel-buildtools
bant
# Profiling and sanitizers.
linuxPackages_latest.perf
pprof
perf_data_converter
valgrind
];
CLANG_TIDY = "${clang_for_tidy}/bin/clang-tidy";
CLANG_FORMAT = "${clang_for_formatting}/bin/clang-format";
shellHook = ''
exec bash
'';
};
}
);
}