-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
84 lines (74 loc) · 1.44 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
pkgs ? import <nixpkgs> {
config = {
allowUnfree = true;
};
},
}:
pkgs.mkShell {
packages = with pkgs; [
# Core Tools
corepack_22
curl
deno
docker
docker-compose
git
git-lfs
mkcert
nodejs_22
openssh
# Code Editors
neovim
vscodium
# Convenience Tools
bat
cargo
direnv
eza
fzf
gawk
hyperfine
jq
openvpn
tealdeer
wget
zq
# shell.nix Dependencies
macchina
which
];
shellHook = ''
macchina
echo "Setting up environment variables..."
export EDITOR=$(which nvim)
export VISUAL=$(which codium)
echo "Setting up shell aliases..."
alias cat=bat
alias code=codium
alias k='$VISUAL $(fzf --multi --preview="bat --color=always {}")'
alias ll="ls -la"
alias ls=eza
alias vim=nvim
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
echo "Setting up Git aliases..."
git config alias.co checkout
git config alias.br branch
git config alias.ci commit
git config alias.st status
git config alias.amend "commit --amend -m"
git config alias.unstage "restore --staged"
git config help.autocorrect 50
else
echo "Not a Git repository."
fi
if [ -f package.json ]; then
corepack install
pnpm install --frozen-lockfile
echo -e "\nCurrent Project: $(jq -r '.name' package.json)\n"
pnpm run
else
echo "\nNot a NodeJS package."
fi
'';
}