Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: oh-my-zsh nix #667

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@
grpcurl grpcui

celestia-app celestia-node

# oh-my-zsh
zsh
oh-my-zsh
coreutils

] ++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
Security CoreServices SystemConfiguration AppKit
]) ++ lib.optionals stdenv.isLinux (with pkgs; [
Expand All @@ -145,22 +151,45 @@
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib/";

shellHook = ''
#!/usr/bin/env ${pkgs.bash}

DOT_MOVEMENT_PATH=$(pwd).movement
mkdir -p $DOT_MOVEMENT_PATH

# export PKG_CONFIG_PATH=$PKG_CONFIG_PATH_FOR_TARGET

echo "Monza Aptos path: $MONZA_APTOS_PATH"
cat <<'EOF'
_ _ __ _ _ ____ _ _ ____ __ _ ____
( \/ ) / \ / )( \( __)( \/ )( __)( ( \(_ _)
/ \/ \( O )\ \/ / ) _) / \/ \ ) _) / / )(
\_)(_/ \__/ \__/ (____)\_)(_/(____)\_)__) (__)
_ _ __ _ _ ____ _ _ ____ __ _ ____
( \/ ) / \ / )( \( __)( \/ )( __)( ( \(_ _)
/ \/ \( O )\ \/ / ) _) / \/ \ ) _) / / )(
\_)(_/ \__/ \__/ (____)\_)(_/(____)\_)__) (__)

EOF

echo "Develop with Move Anywhere"

# Configure oh-my-zsh
export ZDOTDIR=$(pwd)
echo "export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh" > $ZDOTDIR/.zshrc
echo "ZSH_THEME=\"robbyrussell\"" >> $ZDOTDIR/.zshrc
echo "plugins=(git)" >> $ZDOTDIR/.zshrc

cat <<'EOF' >> $ZDOTDIR/.zshrc
prompt_prefix() {
if [[ $PROMPT != *"(mvmt-dev)"* ]]; then
PROMPT="(mvmt-dev) $PROMPT"
fi
}

autoload -Uz add-zsh-hook
add-zsh-hook precmd prompt_prefix
EOF

echo "source \$ZSH/oh-my-zsh.sh" >> $ZDOTDIR/.zshrc
echo "eval \$(dircolors -b)" >> $ZDOTDIR/.zshrc
echo "alias ls='${pkgs.coreutils}/bin/ls --color=auto'" >> $ZDOTDIR/.zshrc

# Start Zsh with this custom .zshrc
if [[ -n "$PS1" && -z "$1" ]]; then
exec ${pkgs.zsh}/bin/zsh
fi
'';
};
};
Expand Down