feat(third_party/gopkgs): add charmbracelet/{bubbletea,bubbles}

A small go TUI framework based on the Elm Architecture.

Change-Id: I0c400a7b25af682735bfc5061db179e5d1dd75ab
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2853
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Profpatsch 2021-04-05 13:56:17 +02:00
parent 7b57165351
commit 952d5480bc
10 changed files with 171 additions and 0 deletions

View file

@ -0,0 +1,16 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/charmbracelet/bubbles";
src = pkgs.fetchFromGitHub {
owner = "charmbracelet";
repo = "bubbles";
# unreleased version required by bubbletea
rev = "v0.7.6";
sha256 = "1gd4k4f2mj2dnqcbpdrh9plziz0l29ls6mgyy4mfdcdfijfyd30n";
};
deps = with depot.third_party; [
gopkgs."github.com".charmbracelet.bubbletea
];
}

View file

@ -0,0 +1,28 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/charmbracelet/bubbletea";
src =
let gitSrc = pkgs.fetchFromGitHub {
owner = "charmbracelet";
repo = "bubbletea";
rev = "v0.13.1";
sha256 = "0yf2fjkvx8ym9n6f3qp2z7sxs0qsfpj148sfvbrp38k67s3h20cs";
};
# The examples/ directory is fairly extensive,
# but it also adds most of the dependencies.
in pkgs.runCommand gitSrc.name {} ''
mkdir -p $out
ln -s "${gitSrc}"/* $out
rm -r $out/examples
rm -r $out/tutorials
'';
deps = with depot.third_party; [
gopkgs."github.com".containerd.console
gopkgs."github.com".mattn.go-isatty
gopkgs."github.com".muesli.reflow.truncate
gopkgs."github.com".muesli.termenv
gopkgs."golang.org".x.sys.unix
gopkgs."golang.org".x.crypto.ssh.terminal
];
}

View file

@ -0,0 +1,21 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/charmbracelet/lipgloss";
src = pkgs.fetchFromGitHub {
owner = "charmbracelet";
repo = "lipgloss";
# unreleased version required by bubbletea
rev = "v0.1.0";
sha256 = "1chhs492rsq7i4mr6qpjv3d89rvsd23ri6psnmil3ah6i286vl06";
};
deps = with depot.third_party; [
# gopkgs."github.com".charmbracelet.bubbletea
gopkgs."github.com".lucasb-eyer.go-colorful
gopkgs."github.com".muesli.reflow.ansi
gopkgs."github.com".muesli.reflow.truncate
gopkgs."github.com".muesli.reflow.wordwrap
gopkgs."github.com".muesli.termenv
];
}

View file

@ -0,0 +1,15 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/containerd/console";
src = pkgs.fetchFromGitHub {
owner = "containerd";
repo = "console";
rev = "v1.0.1";
sha256 = "0s837wj6h80fykk2pdmaji75rw9c3863by0gh0cq51hh0lgyjpvg";
};
deps = with depot.third_party; [
gopkgs."golang.org".x.sys.unix
];
}

View file

@ -0,0 +1,12 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/lucasb-eyer/go-colorful";
src = pkgs.fetchFromGitHub {
owner = "lucasb-eyer";
repo = "go-colorful";
# unreleased version required by bubbletea
rev = "v1.2.0";
sha256 = "08c3fkf27r16izjjd4w94xd1z7w1r4mdalbl53ms2ka2j465s3qs";
};
}

View file

@ -0,0 +1,15 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/mattn/go-isatty";
src = pkgs.fetchFromGitHub {
owner = "mattn";
repo = "go-isatty";
rev = "v0.0.12";
sha256 = "1dfsh27d52wmz0nmmzm2382pfrs2fcijvh6cgir7jbb4pnigr5w4";
};
deps = with depot.third_party; [
gopkgs."golang.org".x.sys.unix
];
}

View file

@ -0,0 +1,15 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/mattn/go-runewidth";
src = pkgs.fetchFromGitHub {
owner = "mattn";
repo = "go-runewidth";
rev = "v0.0.10";
sha256 = "0jh9552ppqvkdfni7x623n0x5mbiaqqhjhmr0zkh28x56k4ysii4";
};
deps = with depot.third_party; [
gopkgs."github.com".rivo.uniseg
];
}

View file

@ -0,0 +1,16 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/muesli/reflow";
src = pkgs.fetchFromGitHub {
owner = "muesli";
repo = "reflow";
# unreleased version required by bubbletea
rev = "9e1d0d53df68baf262851201166872afafd04e5d";
sha256 = "08bmkqdn7sb5laqc1mvgk4xj31f600n1y04s1ifppjvszbcsxhid";
};
deps = with depot.third_party; [
gopkgs."github.com".mattn.go-runewidth
];
}

View file

@ -0,0 +1,19 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/muesli/termenv";
src = pkgs.fetchFromGitHub {
owner = "muesli";
repo = "termenv";
# unreleased version required by bubbletea
rev = "v0.8.1";
sha256 = "0m24ljq1nq7z933fcvg99fw0fhxj9rb5ll4rlay7z2f2p59mrbdp";
};
deps = with depot.third_party; [
gopkgs."github.com".lucasb-eyer.go-colorful
gopkgs."github.com".mattn.go-isatty
gopkgs."github.com".mattn.go-runewidth
gopkgs."golang.org".x.sys.unix
];
}

View file

@ -0,0 +1,14 @@
{ depot, pkgs, ... }:
depot.nix.buildGo.external {
path = "github.com/rivo/uniseg";
src = pkgs.fetchFromGitHub {
owner = "rivo";
repo = "uniseg";
rev = "v0.1.0";
sha256 = "0flpc1px1l6b1lxzhdxi0mvpkkjchppvgxshxxnlmm40s76i9ww5";
};
deps = with depot.third_party; [
];
}