brewery
notashelf /
9df4e8fb8a334a8b613ce0a75fe8a5326b3efd4e

beer

public

A terminal worth pouring time into

Star0tarball
clone
ssh://git@git.notashelf.dev:33/notashelf/beer.git
nix/package.nixNix64 lines1.4 KB
1
{
2
  lib,
3
  rustPlatform,
4
  pkg-config,
5
  makeBinaryWrapper,
6
  ncurses,
7
  wayland,
8
  libxkbcommon,
9
  freetype,
10
  fontconfig,
11
}:
12
rustPlatform.buildRustPackage (finalAttrs: {
13
  pname = "beer";
14
  version = "0.0.1";
15
16
  src = let
17
    fs = lib.fileset;
18
    s = ../.;
19
  in
20
    fs.toSource {
21
      root = s;
22
      fileset = fs.unions [
23
        (fs.fileFilter (file: builtins.any file.hasExt ["rs"]) (s + /src))
24
        (s + /Cargo.lock)
25
        (s + /Cargo.toml)
26
        (s + /terminfo)
27
      ];
28
    };
29
30
  cargoLock.lockFile = "${finalAttrs.src}Cargo.lock";
31
  enableParallelBuilding = true;
32
33
  strictDeps = true;
34
  nativeBuildInputs = [
35
    pkg-config
36
    makeBinaryWrapper
37
    ncurses # tic
38
  ];
39
40
  buildInputs = [
41
    wayland
42
    libxkbcommon
43
    freetype
44
    fontconfig
45
  ];
46
47
  # Install the terminfo entry, and make the Wayland/xkb libraries (loaded via
48
  # dlopen, so not captured by rpath) discoverable at runtime.
49
  postInstall = ''
50
    mkdir -p "$out/share/terminfo"
51
    tic -x -o "$out/share/terminfo" terminfo/beer.info
52
    wrapProgram "$out/bin/beer" \
53
      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [wayland libxkbcommon]}
54
  '';
55
56
  meta = {
57
    description = "A fast, software-rendered, Wayland-native terminal emulator";
58
    homepage = "https://github.com/NotAShelf/beer";
59
    license = lib.licenses.eupl12;
60
    maintainers = with lib.maintainers; [NotAShelf];
61
    mainProgram = "beer";
62
    platforms = lib.platforms.linux;
63
  };
64
})