dotfiles/hosts/strix/system/shell.nix

68 lines
2 KiB
Nix
Raw Normal View History

{ pkgs, user, ... }:
{
2024-04-28 11:35:35 +02:00
users.users.${user}.shell = pkgs.zsh;
2024-04-28 11:35:35 +02:00
programs.zsh.enable = true;
home-manager.users.${user} = {
2024-04-28 11:35:35 +02:00
programs.zsh = {
enable = true;
# TODO create directory if non existent
history.path = "$HOME/zsh/history";
2024-04-28 11:35:35 +02:00
shellAliases = {
update = "doas nixos-rebuild switch --impure";
2024-04-28 11:35:35 +02:00
2025-01-09 09:34:41 +01:00
# Docker shorthands
2024-04-28 11:35:35 +02:00
dc = "docker compose";
dco = "docker container";
dn = "docker network";
dv = "docker volume";
code = "codium";
2025-01-09 09:34:41 +01:00
# Tmux shrothands
# https://github.com/gabysbrain/machine_config/blob/master/config/tmux.nix
ta = "tmux attach -t";
tl = "tmux list-sessions";
2025-01-09 09:34:41 +01:00
tks = "tmux kill-session -t";
tn = "tmux new-session -t";
2024-12-05 07:02:26 +01:00
#dev = "nix develop --command zsh";
2025-01-09 09:34:41 +01:00
dev = ''nix develop "git+file://$(pwd)?submodules=1" --command zsh'';
2024-05-18 01:10:04 +02:00
# ssh
pink = "ssh root@32.54.31.99";
2025-01-13 21:01:09 +01:00
cyan = "ssh 4o1x5@cyan.4o1x5.dev";
carbon = "ssh root@32.54.31.180";
2024-05-18 01:10:04 +02:00
2025-01-09 09:34:41 +01:00
# remote deployment for homelab
2024-05-18 01:10:04 +02:00
deploy-carbon = "nixos-rebuild switch --flake .#carbon --target-host root@32.54.31.180 --show-trace";
deploy-pink = "nixos-rebuild switch --flake .#pink --target-host root@32.54.31.99 --show-trace";
2025-01-13 21:01:09 +01:00
deploy-cyan = "nixos-rebuild switch --flake .#cyan --target-host root@32.221.212.150 --show-trace";
2024-04-28 11:35:35 +02:00
};
initExtra = ''
PROMPT="[%M] %~ "
2024-04-28 11:35:35 +02:00
'';
sessionVariables = {
EDITOR = "nvim";
2025-01-09 09:34:41 +01:00
# https://discourse.nixos.org/t/tmux-doesnt-use-tmux-config-generated-by-nix/42392/2
# for some reason tmux nix doesnt configure tmux right so I have to manually set it's configuration path
2025-01-13 21:01:09 +01:00
# btw this is probably due to tmux looking for the user level tmux config at ~/.config/tmux rather than the system wide one
2025-01-09 09:34:41 +01:00
ZSH_TMUX_CONFIG = "/etc/tmux.conf";
2024-04-28 11:35:35 +02:00
};
antidote = {
2024-04-28 11:35:35 +02:00
enable = true;
plugins = [
"marlonrichert/zsh-autocomplete"
"zsh-users/zsh-syntax-highlighting"
2024-04-28 11:35:35 +02:00
];
};
};
};
}