From 182bd756151ee962d77b36c83ff661dbc8359ba0 Mon Sep 17 00:00:00 2001 From: TheRootDaemon Date: Wed, 28 Oct 2026 12:10:06 +0530 Subject: [PATCH 1/3] chore: Add instructions for NixOS --- README.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f3ecbb6..86c3889 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,56 @@ A [tldr](https://github.com/tldr-pages/tlgc) client written in Go. Download the archive for your platform from the [releases page](https://github.com/TheRootDaemon/tlgc/releases). -### Using Go +### Nix + +Install tlgc using Nix: + +```nix +nix profile install github:TheRootDaemon/tlgc +``` + +Run tlgc without installing it (ephemeral): + +```nix +nix run github:TheRootDaemon/tlgc -- --help +``` + +Use it in your existing flake: + +```nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + tlgc.url = "github:TheRootDaemon/tlgc"; + }; + + outputs = { nixpkgs, tlgc, ... }: { + nixosConfigurations.host = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + + modules = [ + ({ pkgs, ... }: { + environment.systemPackages = [ + tlgc.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + }) + ]; + }; + }; +} +``` + +To use it along with your `home-manager`: + +```nix +{ inputs, pkgs, ... }: { + home.packages = [ + inputs.tlgc.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; +} +``` + +### Go ```sh # This just installs the binary. From ee89717a9610ef8c4139898094d4a29768267a38 Mon Sep 17 00:00:00 2001 From: TheRootDaemon Date: Wed, 28 Oct 2026 12:42:21 +0530 Subject: [PATCH 2/3] feat: PKGBUILD --- .gitignore | 6 ++++++ Makefile | 26 +++++++++++++++++++++++++- PKGBUILD | 31 +++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 PKGBUILD diff --git a/.gitignore b/.gitignore index 04ce1e7..120b4a6 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,9 @@ result result-* .direnv/ .nix-* + +# Archlinux build artifacts +/pkg/ +/src/ +*.pkg.tar.* +*.tar.gz diff --git a/Makefile b/Makefile index 7bd2b04..1a36f16 100644 --- a/Makefile +++ b/Makefile @@ -80,4 +80,28 @@ man: # Maintanence targets .PHONY: clean clean: - rm -rf bin coverage.out + rm -rf \ + bin coverage.out result result-* tldr .SRCINFO \ + pkg/ src/ *.pkg.tar.* *.pkg.tar.zst *.tar.gz \ + *.log *.sig *-debug* .goreleaser-dist dist/ + +# Release targets +.PHONY: pkgsums +pkgsums: + updpkgsums + +.PHONY: pkgbuild +pkgbuild: + makepkg --syncdeps --cleanbuild + +.PHONY: nixbuild +nix-build: + nix build + +.PHONY: nixcheck +nix-check: + nix flake check + +.PHONY: nixupdate +nix-update: + nix flake update diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..dbb8752 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,31 @@ +# Maintainer: TheRootDaemon + +pkgname=tlgc +pkgver=1.0.0 +pkgrel=1 +pkgdesc="A tldr client written in Go" +arch=('x86_64' 'aarch64') +url="https://github.com/TheRootDaemon/tlgc" +license=('MIT') +depends=() +makedepends=('go') +source=("$pkgname-$pkgver.tar.gz::https://github.com/TheRootDaemon/tlgc/archive/refs/tags/v$pkgver.tar.gz") +sha256sums=('4da677a05956869b5bab353d459eb46c3b918c220f6f7efb4dac66e0127f2d82') + +build() { + cd "$pkgname-$pkgver" + export CGO_ENABLED=0 + go build -trimpath \ + -ldflags "-s -w -X github.com/TheRootDaemon/tlgc/version.Version=$pkgver" \ + -o tldr ./cmd/tldr +} + +package() { + cd "$pkgname-$pkgver" + install -Dm755 tldr "$pkgdir/usr/bin/tldr" + install -Dm644 tldr.1 "$pkgdir/usr/share/man/man1/tldr.1" + install -Dm644 completions/tldr.bash "$pkgdir/usr/share/bash-completion/completions/tldr" + install -Dm644 completions/tldr.fish "$pkgdir/usr/share/fish/vendor_completions.d/tldr.fish" + install -Dm644 completions/_tldr "$pkgdir/usr/share/zsh/site-functions/_tldr" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} From cbed91642366129723a16838c819194a81c6be69 Mon Sep 17 00:00:00 2001 From: TheRootDaemon Date: Fri, 30 Oct 2026 22:05:54 +0530 Subject: [PATCH 3/3] chore: Add instructions for homebrew --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 86c3889..aeaa4b0 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,14 @@ A [tldr](https://github.com/tldr-pages/tlgc) client written in Go. Download the archive for your platform from the [releases page](https://github.com/TheRootDaemon/tlgc/releases). +### Homebrew + +Install `tlgc` by adding a tap: + +```sh +brew tap therootdaemon/tlgc && brew install tlgc +``` + ### Nix Install tlgc using Nix: