dotfiles/nix/system/shell.nix

80 lines
2 KiB
Nix
Executable file

{ pkgs, user, ... }:
{
users.users.${user}.shell = pkgs.zsh;
programs.zsh.enable = true;
programs.tmux = {
enable = true;
};
home-manager.users.${user} = {
programs.zsh = {
enable = true;
# TODO create directory if non existent
history.path = "$HOME/zsh/history";
shellAliases = {
update = "doas nixos-rebuild switch --impure";
# docker
dc = "docker compose";
dco = "docker container";
dn = "docker network";
dv = "docker volume";
code = "codium";
# tmux
# https://github.com/gabysbrain/machine_config/blob/master/config/tmux.nix
ta = "tmux attach -t";
tad = "tmux attach -d -t";
ts = "tmux new-session -s";
tl = "tmux list-sessions";
tkss = "tmux kill-session -t";
tt = "tmux new-session -t";
#nix
garbage = "nix-collect-garbage -d";
#dev = "nix develop --command zsh";
dev = ''nix develop "git+file://$(pwd)?submodules=1" --command zsh'';
# ssh
pink = "ssh root@32.54.31.99";
yellow = "ssh root@32.54.31.5";
carbon = "ssh root@32.54.31.180";
lime = "ssh root@32.54.31.241";
# remote deployment
deploy-carbon = "nixos-rebuild switch --flake .#carbon --target-host root@32.54.31.180 --show-trace";
deploy-lime = "nixos-rebuild switch --flake .#lime --target-host root@32.54.31.241 --show-trace";
deploy-pink = "nixos-rebuild switch --flake .#pink --target-host root@32.54.31.99 --show-trace";
};
initExtra = ''
PROMPT="[%M] %~ "
'';
sessionVariables = {
EDITOR = "nvim";
};
antidote = {
enable = true;
plugins = [
"marlonrichert/zsh-autocomplete"
"zsh-users/zsh-syntax-highlighting"
];
# Zplug
# plugins = [
# { name = "marlonrichert/zsh-autocomplete"; }
# { name = "zsh-users/zsh-syntax-highlighting"; }
# ];
#
};
};
};
}