treewide: split terminal core modules

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I9cace0b7c6995c0fca21ff2cf465ae1f6a6a6964
This commit is contained in:
raf 2026-06-25 14:42:15 +03:00
commit 5cba919c78
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
13 changed files with 1876 additions and 1700 deletions

View file

@ -10,66 +10,68 @@
libxkbcommon,
freetype,
fontconfig,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "beer";
version = "0.0.1";
}: let
cargoTOML = (lib.importTOML ../Cargo.toml).package.version;
in
rustPlatform.buildRustPackage (finalAttrs: {
pname = "beer";
version = cargoTOML.package.version;
src = let
fs = lib.fileset;
s = ../.;
in
fs.toSource {
root = s;
fileset = fs.unions [
(fs.fileFilter (file: builtins.any file.hasExt ["rs"]) (s + /src))
(s + /Cargo.lock)
(s + /Cargo.toml)
(s + /terminfo)
(s + /doc)
];
src = let
fs = lib.fileset;
s = ../.;
in
fs.toSource {
root = s;
fileset = fs.unions [
(s + /src)
(s + /Cargo.lock)
(s + /Cargo.toml)
(s + /terminfo)
(s + /doc)
];
};
cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock";
enableParallelBuilding = true;
strictDeps = true;
nativeBuildInputs = [
pkg-config
makeBinaryWrapper
ncurses # tic
scdoc # man page generation
installShellFiles # installManPage
];
buildInputs = [
wayland
libxkbcommon
freetype
fontconfig
];
# Install the terminfo entry, and make the Wayland/xkb libraries (loaded via
# dlopen, so not captured by rpath) discoverable at runtime.
postInstall = ''
mkdir -p "$out/share/terminfo"
tic -x -o "$out/share/terminfo" terminfo/beer.info
# Generate the man pages from their scdoc sources.
scdoc < doc/beer.1.scd > beer.1
scdoc < doc/beer.toml.5.scd > beer.toml.5
installManPage beer.1 beer.toml.5
wrapProgram "$out/bin/beer" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [wayland libxkbcommon]}
'';
meta = {
description = "A fast, software-rendered, Wayland-native terminal emulator";
homepage = "https://github.com/NotAShelf/beer";
license = lib.licenses.eupl12;
maintainers = with lib.maintainers; [NotAShelf];
mainProgram = "beer";
platforms = lib.platforms.linux;
};
cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock";
enableParallelBuilding = true;
strictDeps = true;
nativeBuildInputs = [
pkg-config
makeBinaryWrapper
ncurses # tic
scdoc # man page generation
installShellFiles # installManPage
];
buildInputs = [
wayland
libxkbcommon
freetype
fontconfig
];
# Install the terminfo entry, and make the Wayland/xkb libraries (loaded via
# dlopen, so not captured by rpath) discoverable at runtime.
postInstall = ''
mkdir -p "$out/share/terminfo"
tic -x -o "$out/share/terminfo" terminfo/beer.info
# Generate the man pages from their scdoc sources.
scdoc < doc/beer.1.scd > beer.1
scdoc < doc/beer.toml.5.scd > beer.toml.5
installManPage beer.1 beer.toml.5
wrapProgram "$out/bin/beer" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [wayland libxkbcommon]}
'';
meta = {
description = "A fast, software-rendered, Wayland-native terminal emulator";
homepage = "https://github.com/NotAShelf/beer";
license = lib.licenses.eupl12;
maintainers = with lib.maintainers; [NotAShelf];
mainProgram = "beer";
platforms = lib.platforms.linux;
};
})
})