aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-09-23 10:14:34 -0300
committerEuAndreh <eu@euandre.org>2023-09-23 10:14:59 -0300
commitacd8b2f01240dd0d5e7291bdd145d526a7094ea9 (patch)
tree43d22889e57d219be9fd9ca99681e8eaca06466d
parentetc/guix/home.scm: Add WIP package definition for perlcritic(1) (diff)
downloaddotfiles-acd8b2f01240dd0d5e7291bdd145d526a7094ea9.tar.gz
dotfiles-acd8b2f01240dd0d5e7291bdd145d526a7094ea9.tar.xz
etc/guix/home.scm: Finish packaging of "tg"
-rw-r--r--etc/guix/home.scm70
-rw-r--r--etc/sh/rc4
2 files changed, 56 insertions, 18 deletions
diff --git a/etc/guix/home.scm b/etc/guix/home.scm
index e38b922..0b9ae36 100644
--- a/etc/guix/home.scm
+++ b/etc/guix/home.scm
@@ -36,10 +36,12 @@
javascript
less
man
+ messaging
perl
perl-check
pkg-config
python
+ python-build
python-crypto
python-web
python-xyz
@@ -355,24 +357,24 @@ libraries/software/operating systems
ANSI Common Lisp standard."#)
(license licenses:public-domain)))
-(define python-telegram-text
+;; See:
+;; https://github.com/NixOS/nixpkgs/issues/256704#issuecomment-1731626031
+(define tdlib@1.8.4
(package
- (name "python-telegram-text")
- (version "0.1.2")
+ (inherit tdlib)
+ (version "1.8.4")
(source
(origin
- (method url-fetch)
+ (method git-fetch)
(uri
- (pypi-uri "telegram_text" version))
+ (git-reference
+ (url "https://github.com/tdlib/td")
+ (commit "7eabd8ca60de025e45e99d4e5edd39f4ebd9467e")))
+ (file-name
+ (git-file-name "tdlib" version))
(sha256
- (base32 "1ayrcfr2v9jzwcpdsl6aahl9mbslx4rbsn3fsqvvw8p4fikxqrxc"))))
- (build-system pyproject-build-system)
- (home-page "https://telegram-text.alinsky.tech")
- (synopsis "Python module for Telegram markup")
- (description #"-
- This module provides a rich list of components to build any possible
- markup fast and render it to specific HTML or @code{MarkdownV2} formats."#)
- (license licenses:expat)))
+ (base32 "1chs0ibghjj275v9arsn3k68ppblpm7ysqk0za9kya5vdnldlld5"))))))
+
(define python-telegram
(package
@@ -386,8 +388,24 @@ libraries/software/operating systems
(sha256
(base32 "0w61z0915mixxkcvwk22az032j3y46gkg8sadi5fqqb04li8vb9m"))))
(build-system pyproject-build-system)
- (propagated-inputs
- (list #;python-telegram-text))
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'unvendor
+ (lambda _
+ (delete-file-recursively "telegram/lib/")))
+ (add-after 'unvendor 'fix-find-library
+ (lambda _
+ (substitute* "telegram/tdjson.py"
+ (("= _get_tdjson_lib_path\\(\\)")
+ (string-append
+ "= \""
+ #$(this-package-input "tdlib")
+ "/lib/libtdjson.so\""))))))))
+ (inputs
+ (list
+ tdlib@1.8.4))
(home-page "https://github.com/alexander-akhmetov/python-telegram")
(synopsis "Python library to help you build your own Telegram clients")
(description #"-
@@ -407,11 +425,27 @@ libraries/software/operating systems
(sha256
(base32 "1jv9npas46pwl7v31xi7rlgm7bri3ydwqqq6wpgi13pp3byx46ig"))))
(build-system pyproject-build-system)
+ (arguments
+ (list
+ #:tests? #f ; no tests
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-hardcoded-api-keys
+ (lambda _
+ (substitute* "tg/config.py"
+ (("API_ID = .*")
+ "API_ID = os.getenv(\"TG_API_ID\")\n")
+ (("API_HASH = .*")
+ "API_HASH = os.getenv(\"TG_API_HASH\")\n")))))))
+ (native-inputs
+ (list
+ python-poetry-core))
(propagated-inputs
- (list python-telegram))
+ (list
+ python-telegram))
(home-page "https://github.com/paul-nameless/tg")
(synopsis "Terminal Telegram client")
- (description "FIXME")
+ (description "TUI client for Telegram with vi-like bindings.")
(license licenses:unlicense)))
(define-public offpunk
@@ -959,7 +993,7 @@ libraries/software/operating systems
apk-tools
;; neosurf
hunspell-iconv
- ;; tg
+ tg
offpunk
(hunspell-dictionary-utf8 "en")
(hunspell-dictionary-utf8 "pt")
diff --git a/etc/sh/rc b/etc/sh/rc
index df07f8e..cf61f03 100644
--- a/etc/sh/rc
+++ b/etc/sh/rc
@@ -103,6 +103,10 @@ export BORG_PASSCOMMAND="pass show $HOSTNAME/borg"
export BORG_REPO="suyin:borg/$HOSTNAME"
export BORG_REMOTE_PATH='borg1'
+TG_API_ID="$(pass show tg/api_id)"
+TG_API_HASH="$(pass show tg/api_hash)"
+export TG_API_ID TG_API_HASH
+
NPROC="$(nproc)"
export NPROC
GUILE_EFFECTIVE_VERSION="$(guile -c '(display (effective-version))')"