Skip to content

Commit

Permalink
term-do: back in the house
Browse files Browse the repository at this point in the history
term-do is over 10 years old now, but still compiles and works
  • Loading branch information
malloc47 committed Apr 18, 2022
1 parent 814bbc5 commit 50710dd
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ with pkgs.lib;
python-language-server
sbt
scrot
term-do
unzip
zip
zoom-us
Expand Down Expand Up @@ -285,6 +286,8 @@ with pkgs.lib;
''
hg() { history | grep $1 }
pg() { ps aux | grep $1 }
bindkey -s "^[x" 'term-do^M'
term-do() {command term-do "$*" && builtin cd $(cat ~/.term-do.d/pwd)}
function chpwd() {
emulate -L zsh
Expand Down Expand Up @@ -319,6 +322,10 @@ with pkgs.lib;
hg() { history | grep "$1"; }
pg() { ps aux | grep "$1"; }
cd() { if [[ -n "$1" ]]; then builtin cd "$1" && ls; else builtin cd && ls; fi }
term-do() {
command term-do "$*"
builtin cd $(cat ~/.term-do.d/pwd)
}
export PS1="λ \w \$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') "
'';
sessionVariables = {
Expand Down
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
geosanslight = super.callPackage geosanslight/default.nix {};
inconsolata-unstable = super.callPackage inconsolata-unstable/default.nix {};
aws-okta = super.callPackage aws-okta/default.nix {};
term-do = super.callPackage term-do/default.nix {};
}
)
51 changes: 51 additions & 0 deletions pkgs/term-do/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, gnumake
, gcc
, boost}:

stdenv.mkDerivation rec {
pname = "term-do";
version = "1.0";

src = fetchFromGitHub {
owner = "malloc47";
repo = pname;
rev = "7048f78f1d01f1edb01fb1869c41d617c938f8b4";
sha256 = "1pw4583sc4yvd2x5i5f470l6pxcpyykk6a5c0di1c7kmfr5rn1wf";
};

nativeBuildInputs = [
makeWrapper
];

buildInputs = [
gnumake
gcc
boost
];

outputs = [ "out" ];

buildPhase = ''
make all
'';

installPhase = ''
make DESTDIR=$out install
mkdir -p $out/etc/term-do/
cp launcher $out/etc/term-do/
makeWrapper $out/bin/term-core $out/bin/term-do \
--set TD_PLUGINS $out/lib/term-do/plugins/ \
--set TD_LAUNCHER $out/etc/term-do/launcher
'';

meta = {
description = "Hybrid of gnome-do and ido mode for a standard vt100 terminal";
homepage = "https://github.com/malloc47/term-do";
license = lib.licenses.bsd2;
platforms = lib.platforms.linux;
};
}

0 comments on commit 50710dd

Please sign in to comment.