Skip to content

Instantly share code, notes, and snippets.

@alexhrescale
Last active January 16, 2019 19:24
Show Gist options
  • Save alexhrescale/8404bf47cf98dc77fcde751eecb4d713 to your computer and use it in GitHub Desktop.
Save alexhrescale/8404bf47cf98dc77fcde751eecb4d713 to your computer and use it in GitHub Desktop.
quick tmux shell env
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "dev-env";
env = pkgs.buildEnv {
name = name;
paths = buildInputs;
};
buildInputs = [
(vim_configurable.override {
features = "huge";
python = python3;
})
tmux
zsh
oh-my-zsh
];
shellHook = ''
if [ ! -e $HOME/.zshrc ]; then
cat > $HOME/.zshrc <<-EOF
export ZSH="${pkgs.oh-my-zsh}/share/oh-my-zsh/"
export ZSH_THEME=cloud
plugins=(git)
source \$ZSH/oh-my-zsh.sh
EOF
fi
if [ ! -e $HOME/.tmux.conf ]; then
cat > $HOME/.tmux.conf <<-EOF
set -g history-limit 10000
set-option -g default-shell ${pkgs.zsh}/bin/zsh
EOF
fi
if [ $(tmux list-sessions 2>/dev/null | wc -l) -eq 0 ]; then
tmux
else
tmux a
fi
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment