ShitScript/shell.nix

43 lines
717 B
Nix

{pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = [
pkgs.cbonsai
pkgs.cmatrix
pkgs.neo-cowsay
pkgs.fortune
pkgs.nyancat
pkgs.coreutils
];
shellHook = ''
STIME=5
programs="cmatrix cbonsai nyancat fortuneCow"
trap 'stty sane; tput cnorm; clear' EXIT
while true; do
choice=$(echo "$programs" | tr ' ' '\n' | shuf -n 1)
clear
tput sgr0
case "$choice" in
cbonsai)
cbonsai -t .2
sleep "$STIME"
;;
cmatrix)
bash -c "cmatrix -u 4 & pid=\$!; sleep $STIME; kill -INT \$pid; wait \$pid"
;;
nyancat)
timeout "$STIME" nyancat
;;
fortuneCow)
fortune | cowsay
sleep "$STIME"
;;
esac
sleep 1
done
'';
}