Skip to content

Commit 127fe55

Browse files
committed
🚸 Support NixOS
1 parent bef9ccd commit 127fe55

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Wu Zhenyu <wuzhenyu@ustc.edu> Wu, Zhenyu <wuzhenyu@ustc.edu>

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ repos:
7777
rev: v1.1.390
7878
hooks:
7979
- id: pyright
80-
args:
81-
- -cpyproject.toml
82-
additional_dependencies:
83-
- tomli
8480

8581
ci:
8682
skip:

bitahub.tmux

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/usr/bin/env python
22
"""Respect tmux plugin standard."""
3+
34
import os
45
import sys
56

6-
sys.path.insert(
7-
0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "src")
8-
)
7+
root = os.path.dirname(os.path.abspath(__file__))
8+
sys.path.insert(0, os.path.join(root, "src"))
9+
10+
try:
11+
from tmux_bitahub.__main__ import main
912

10-
from tmux_bitahub.__main__ import main
13+
main()
14+
except ImportError:
15+
if os.path.exists("/run/current-system/nixos-version"):
16+
from subprocess import run
1117

12-
main()
18+
run(("nix-shell", "--run", os.path.join(root, "bitahub.tmux")))

shell.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ with pkgs;
44
mkShell {
55
name = "tmux-bitahub";
66
buildInputs = [
7+
tmux
8+
79
(python3.withPackages (
810
p: with p; [
911
beautifulsoup4

0 commit comments

Comments
 (0)