beer/nix/shell.nix
NotAShelf 8486c343d7
nix: load terminfo in the devshell and complete the package build
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9d341443399d553c197f56bf66a578426a6a6964
2026-06-26 10:21:21 +03:00

55 lines
1,010 B
Nix

{
mkShell,
rustc,
cargo,
rust-analyzer,
rustfmt,
clippy,
taplo,
cargo-deny,
pkg-config,
ncurses,
wayland,
wayland-protocols,
wayland-scanner,
libxkbcommon,
freetype,
fontconfig,
harfbuzz,
}:
mkShell {
name = "beer-dev";
strictDeps = true;
nativeBuildInputs = [
cargo
rustc
clippy
rustfmt
taplo
rust-analyzer
cargo-deny
pkg-config
ncurses # tic, to compile the terminfo entry
];
buildInputs = [
wayland
wayland-protocols
wayland-scanner
libxkbcommon
freetype
fontconfig
harfbuzz
];
# Compile the beer terminfo into a project-local database and put it ahead of
# the system one, so TERM=beer resolves inside the shell (and for the shell
# beer spawns, which inherits this env). The trailing ':' keeps the system
# database on the search path.
shellHook = ''
if tic -x -o "$PWD/.terminfo" terminfo/beer.info 2>/dev/null; then
export TERMINFO_DIRS="$PWD/.terminfo:"
fi
'';
}